From 7a0eef61d0b26a613a6ae621885ad33ebda5c8f3 Mon Sep 17 00:00:00 2001 From: xhh Date: Tue, 29 Mar 2016 18:17:51 +0800 Subject: [PATCH] Add enum to Java docs * Parameter enum values * Inner enum class (model property) * Outer enum class (enum model/definition) --- .../src/main/resources/Java/api_doc.mustache | 2 +- .../resources/Java/enum_outer_doc.mustache | 7 ++ .../okhttp-gson/enum_outer_doc.mustache | 7 ++ .../libraries/okhttp-gson/model_doc.mustache | 3 + .../main/resources/Java/model_doc.mustache | 10 +- .../src/main/resources/Java/pojo_doc.mustache | 15 +++ .../client/petstore/java/default/README.md | 3 + .../petstore/java/default/docs/Animal.md | 10 ++ .../client/petstore/java/default/docs/Cat.md | 11 +++ .../petstore/java/default/docs/Category.md | 2 + .../client/petstore/java/default/docs/Dog.md | 11 +++ .../java/default/docs/InlineResponse200.md | 13 ++- .../java/default/docs/Model200Response.md | 2 + .../petstore/java/default/docs/ModelReturn.md | 2 + .../client/petstore/java/default/docs/Name.md | 2 + .../petstore/java/default/docs/Order.md | 13 ++- .../client/petstore/java/default/docs/Pet.md | 13 ++- .../petstore/java/default/docs/PetApi.md | 30 +++--- .../java/default/docs/SpecialModelName.md | 2 + .../petstore/java/default/docs/StoreApi.md | 8 +- .../client/petstore/java/default/docs/Tag.md | 2 + .../client/petstore/java/default/docs/User.md | 2 + .../petstore/java/default/docs/UserApi.md | 18 ++-- .../java/io/swagger/client/model/Animal.java | 74 ++++++++++++++ .../java/io/swagger/client/model/Cat.java | 96 +++++++++++++++++++ .../java/io/swagger/client/model/Dog.java | 96 +++++++++++++++++++ .../petstore/java/okhttp-gson/README.md | 3 + .../petstore/java/okhttp-gson/docs/Animal.md | 10 ++ .../petstore/java/okhttp-gson/docs/Cat.md | 11 +++ .../java/okhttp-gson/docs/Category.md | 2 + .../petstore/java/okhttp-gson/docs/Dog.md | 11 +++ .../okhttp-gson/docs/InlineResponse200.md | 13 ++- .../java/okhttp-gson/docs/Model200Response.md | 2 + .../java/okhttp-gson/docs/ModelReturn.md | 2 + .../petstore/java/okhttp-gson/docs/Name.md | 2 + .../petstore/java/okhttp-gson/docs/Order.md | 13 ++- .../petstore/java/okhttp-gson/docs/Pet.md | 13 ++- .../petstore/java/okhttp-gson/docs/PetApi.md | 30 +++--- .../java/okhttp-gson/docs/SpecialModelName.md | 2 + .../java/okhttp-gson/docs/StoreApi.md | 8 +- .../petstore/java/okhttp-gson/docs/Tag.md | 2 + .../petstore/java/okhttp-gson/docs/User.md | 2 + .../petstore/java/okhttp-gson/docs/UserApi.md | 18 ++-- .../java/io/swagger/client/model/Animal.java | 69 +++++++++++++ .../java/io/swagger/client/model/Cat.java | 87 +++++++++++++++++ .../java/io/swagger/client/model/Dog.java | 87 +++++++++++++++++ 46 files changed, 770 insertions(+), 71 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/Java/enum_outer_doc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model_doc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Java/pojo_doc.mustache create mode 100644 samples/client/petstore/java/default/docs/Animal.md create mode 100644 samples/client/petstore/java/default/docs/Cat.md create mode 100644 samples/client/petstore/java/default/docs/Dog.md create mode 100644 samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java create mode 100644 samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java create mode 100644 samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/Animal.md create mode 100644 samples/client/petstore/java/okhttp-gson/docs/Cat.md create mode 100644 samples/client/petstore/java/okhttp-gson/docs/Dog.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java diff --git a/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache index 870e889d208..36788cd8614 100644 --- a/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache @@ -62,7 +62,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/swagger-codegen/src/main/resources/Java/enum_outer_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/enum_outer_doc.mustache new file mode 100644 index 00000000000..14b5d524c4a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/enum_outer_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}} +* `{{.}}` +{{/allowableValues}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache new file mode 100644 index 00000000000..a7e706eba4e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{value}}`) +{{#enumVars}}{{/allowableValues}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model_doc.mustache new file mode 100644 index 00000000000..a3703db3bf9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model_doc.mustache @@ -0,0 +1,3 @@ +{{#models}}{{#model}} +{{#isEnum}}{{>libraries/okhttp-gson/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>pojo_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/Java/model_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/model_doc.mustache index 2f330e2eb98..658df8d5322 100644 --- a/modules/swagger-codegen/src/main/resources/Java/model_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/model_doc.mustache @@ -1,9 +1,3 @@ -{{#models}}{{#model}}# {{classname}} - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}} [optional]{{/required}}{{#readOnly}} [readonly]{{/readOnly}} -{{/vars}} - +{{#models}}{{#model}} +{{#isEnum}}{{>enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>pojo_doc}}{{/isEnum}} {{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo_doc.mustache new file mode 100644 index 00000000000..0e4c0749866 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/pojo_doc.mustache @@ -0,0 +1,15 @@ +# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#readOnly}} [readonly]{{/readOnly}} +{{/vars}} +{{#vars}}{{#isEnum}} + + +## Enum: {{datatypeWithEnum}} +Name | Value +---- | -----{{#allowableValues}}{{#enumVars}} +{{name}} | {{value}}{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}} diff --git a/samples/client/petstore/java/default/README.md b/samples/client/petstore/java/default/README.md index 28d6bdf5ba9..562d76a8db4 100644 --- a/samples/client/petstore/java/default/README.md +++ b/samples/client/petstore/java/default/README.md @@ -127,7 +127,10 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Animal](docs/Animal.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) + - [Dog](docs/Dog.md) - [InlineResponse200](docs/InlineResponse200.md) - [Model200Response](docs/Model200Response.md) - [ModelReturn](docs/ModelReturn.md) diff --git a/samples/client/petstore/java/default/docs/Animal.md b/samples/client/petstore/java/default/docs/Animal.md new file mode 100644 index 00000000000..3ecb7f991f3 --- /dev/null +++ b/samples/client/petstore/java/default/docs/Animal.md @@ -0,0 +1,10 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/default/docs/Cat.md b/samples/client/petstore/java/default/docs/Cat.md new file mode 100644 index 00000000000..373af540c41 --- /dev/null +++ b/samples/client/petstore/java/default/docs/Cat.md @@ -0,0 +1,11 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/default/docs/Category.md b/samples/client/petstore/java/default/docs/Category.md index 3a0290a90bc..e2df0803278 100644 --- a/samples/client/petstore/java/default/docs/Category.md +++ b/samples/client/petstore/java/default/docs/Category.md @@ -1,3 +1,4 @@ + # Category ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **name** | **String** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/Dog.md b/samples/client/petstore/java/default/docs/Dog.md new file mode 100644 index 00000000000..a1d638d3bad --- /dev/null +++ b/samples/client/petstore/java/default/docs/Dog.md @@ -0,0 +1,11 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/default/docs/InlineResponse200.md b/samples/client/petstore/java/default/docs/InlineResponse200.md index 232cb0ed5c1..487ebe429e4 100644 --- a/samples/client/petstore/java/default/docs/InlineResponse200.md +++ b/samples/client/petstore/java/default/docs/InlineResponse200.md @@ -1,3 +1,4 @@ + # InlineResponse200 ## Properties @@ -8,6 +9,16 @@ Name | Type | Description | Notes **id** | **Long** | | **category** | **Object** | | [optional] **tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | available +PENDING | pending +SOLD | sold + diff --git a/samples/client/petstore/java/default/docs/Model200Response.md b/samples/client/petstore/java/default/docs/Model200Response.md index f4dbac7897f..0819b88c4f4 100644 --- a/samples/client/petstore/java/default/docs/Model200Response.md +++ b/samples/client/petstore/java/default/docs/Model200Response.md @@ -1,3 +1,4 @@ + # Model200Response ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **name** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/ModelReturn.md b/samples/client/petstore/java/default/docs/ModelReturn.md index fbeb9eefde6..a679b04953e 100644 --- a/samples/client/petstore/java/default/docs/ModelReturn.md +++ b/samples/client/petstore/java/default/docs/ModelReturn.md @@ -1,3 +1,4 @@ + # ModelReturn ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **_return** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/Name.md b/samples/client/petstore/java/default/docs/Name.md index 3cecd0c7b74..0d98e5b0fff 100644 --- a/samples/client/petstore/java/default/docs/Name.md +++ b/samples/client/petstore/java/default/docs/Name.md @@ -1,3 +1,4 @@ + # Name ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **snakeCase** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/Order.md b/samples/client/petstore/java/default/docs/Order.md index 07703353044..b1709c14eee 100644 --- a/samples/client/petstore/java/default/docs/Order.md +++ b/samples/client/petstore/java/default/docs/Order.md @@ -1,3 +1,4 @@ + # Order ## Properties @@ -7,7 +8,17 @@ Name | Type | Description | Notes **petId** | **Long** | | [optional] **quantity** | **Integer** | | [optional] **shipDate** | [**Date**](Date.md) | | [optional] -**status** | **String** | Order Status | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] **complete** | **Boolean** | | [optional] + +## Enum: StatusEnum +Name | Value +---- | ----- +PLACED | placed +APPROVED | approved +DELIVERED | delivered + + + diff --git a/samples/client/petstore/java/default/docs/Pet.md b/samples/client/petstore/java/default/docs/Pet.md index 4676687984e..20a1c298dd6 100644 --- a/samples/client/petstore/java/default/docs/Pet.md +++ b/samples/client/petstore/java/default/docs/Pet.md @@ -1,3 +1,4 @@ + # Pet ## Properties @@ -8,6 +9,16 @@ Name | Type | Description | Notes **name** | **String** | | **photoUrls** | **List<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | available +PENDING | pending +SOLD | sold + diff --git a/samples/client/petstore/java/default/docs/PetApi.md b/samples/client/petstore/java/default/docs/PetApi.md index 1c97c809ca0..c8a34039885 100644 --- a/samples/client/petstore/java/default/docs/PetApi.md +++ b/samples/client/petstore/java/default/docs/PetApi.md @@ -54,7 +54,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -106,7 +106,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **byte[]**| Pet object in the form of byte array | [optional] + **body** | **byte[]**| Pet object in the form of byte array | [optional] ### Return type @@ -159,8 +159,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -266,7 +266,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [optional] + **tags** | [**List<String>**](String.md)| Tags to filter by | [optional] ### Return type @@ -325,7 +325,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -384,7 +384,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -443,7 +443,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -495,7 +495,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -549,9 +549,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **String**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] + **petId** | **String**| 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 @@ -605,9 +605,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/java/default/docs/SpecialModelName.md b/samples/client/petstore/java/default/docs/SpecialModelName.md index e8ebae01a3b..c2c6117c552 100644 --- a/samples/client/petstore/java/default/docs/SpecialModelName.md +++ b/samples/client/petstore/java/default/docs/SpecialModelName.md @@ -1,3 +1,4 @@ + # SpecialModelName ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **specialPropertyName** | **Long** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/StoreApi.md b/samples/client/petstore/java/default/docs/StoreApi.md index 544081e5d68..b521b1a65ac 100644 --- a/samples/client/petstore/java/default/docs/StoreApi.md +++ b/samples/client/petstore/java/default/docs/StoreApi.md @@ -41,7 +41,7 @@ try { 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 | ### Return type @@ -102,7 +102,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **String**| Status value that needs to be considered for query | [optional] [default to placed] + **status** | **String**| Status value that needs to be considered for query | [optional] [default to placed] [enum: placed, approved, delivered] ### Return type @@ -265,7 +265,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of pet that needs to be fetched | + **orderId** | **String**| ID of pet that needs to be fetched | ### Return type @@ -326,7 +326,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] + **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] ### Return type diff --git a/samples/client/petstore/java/default/docs/Tag.md b/samples/client/petstore/java/default/docs/Tag.md index cd4df387983..de6814b55d5 100644 --- a/samples/client/petstore/java/default/docs/Tag.md +++ b/samples/client/petstore/java/default/docs/Tag.md @@ -1,3 +1,4 @@ + # Tag ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **name** | **String** | | [optional] + diff --git a/samples/client/petstore/java/default/docs/User.md b/samples/client/petstore/java/default/docs/User.md index b948c270267..8b6753dd284 100644 --- a/samples/client/petstore/java/default/docs/User.md +++ b/samples/client/petstore/java/default/docs/User.md @@ -1,3 +1,4 @@ + # User ## Properties @@ -13,3 +14,4 @@ Name | Type | Description | Notes **userStatus** | **Integer** | User Status | [optional] + diff --git a/samples/client/petstore/java/default/docs/UserApi.md b/samples/client/petstore/java/default/docs/UserApi.md index 571d547a079..3e1553c82c5 100644 --- a/samples/client/petstore/java/default/docs/UserApi.md +++ b/samples/client/petstore/java/default/docs/UserApi.md @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | [optional] + **body** | [**User**](User.md)| Created user object | [optional] ### Return type @@ -87,7 +87,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | [optional] + **body** | [**List<User>**](User.md)| List of user object | [optional] ### Return type @@ -131,7 +131,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | [optional] + **body** | [**List<User>**](User.md)| List of user object | [optional] ### Return type @@ -184,7 +184,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | **String**| The name that needs to be deleted | ### Return type @@ -229,7 +229,7 @@ try { 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. | ### Return type @@ -275,8 +275,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [optional] - **password** | **String**| The password for login in clear text | [optional] + **username** | **String**| The user name for login | [optional] + **password** | **String**| The password for login in clear text | [optional] ### Return type @@ -361,8 +361,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | [optional] + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | [optional] ### Return type diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java new file mode 100644 index 00000000000..0627486417f --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java @@ -0,0 +1,74 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-29T18:13:32.007+08:00") +public class Animal { + + private String className = null; + + + /** + **/ + public Animal className(String className) { + this.className = className; + return this; + } + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("className") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).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/java/default/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java new file mode 100644 index 00000000000..419720f2dd6 --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java @@ -0,0 +1,96 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.Animal; + + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-29T18:13:32.007+08:00") +public class Cat extends Animal { + + private String className = null; + private Boolean declawed = null; + + + /** + **/ + public Cat className(String className) { + this.className = className; + return this; + } + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("className") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + **/ + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.className, cat.className) && + Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(className, declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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/java/default/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java new file mode 100644 index 00000000000..9abb680b980 --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java @@ -0,0 +1,96 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.Animal; + + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-29T18:13:32.007+08:00") +public class Dog extends Animal { + + private String className = null; + private String breed = null; + + + /** + **/ + public Dog className(String className) { + this.className = className; + return this; + } + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("className") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + **/ + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.className, dog.className) && + Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(className, breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 4d2488308e6..f2b11d703c2 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -127,7 +127,10 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Animal](docs/Animal.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) + - [Dog](docs/Dog.md) - [InlineResponse200](docs/InlineResponse200.md) - [Model200Response](docs/Model200Response.md) - [ModelReturn](docs/ModelReturn.md) diff --git a/samples/client/petstore/java/okhttp-gson/docs/Animal.md b/samples/client/petstore/java/okhttp-gson/docs/Animal.md new file mode 100644 index 00000000000..3ecb7f991f3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/Animal.md @@ -0,0 +1,10 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Cat.md b/samples/client/petstore/java/okhttp-gson/docs/Cat.md new file mode 100644 index 00000000000..373af540c41 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/Cat.md @@ -0,0 +1,11 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Category.md b/samples/client/petstore/java/okhttp-gson/docs/Category.md index 3a0290a90bc..e2df0803278 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Category.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Category.md @@ -1,3 +1,4 @@ + # Category ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **name** | **String** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Dog.md b/samples/client/petstore/java/okhttp-gson/docs/Dog.md new file mode 100644 index 00000000000..a1d638d3bad --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/Dog.md @@ -0,0 +1,11 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md b/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md index 232cb0ed5c1..487ebe429e4 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md +++ b/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md @@ -1,3 +1,4 @@ + # InlineResponse200 ## Properties @@ -8,6 +9,16 @@ Name | Type | Description | Notes **id** | **Long** | | **category** | **Object** | | [optional] **tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | available +PENDING | pending +SOLD | sold + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md index f4dbac7897f..0819b88c4f4 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md @@ -1,3 +1,4 @@ + # Model200Response ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **name** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md index fbeb9eefde6..a679b04953e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md @@ -1,3 +1,4 @@ + # ModelReturn ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **_return** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Name.md b/samples/client/petstore/java/okhttp-gson/docs/Name.md index 3cecd0c7b74..0d98e5b0fff 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Name.md @@ -1,3 +1,4 @@ + # Name ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **snakeCase** | **Integer** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Order.md b/samples/client/petstore/java/okhttp-gson/docs/Order.md index 07703353044..b1709c14eee 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Order.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Order.md @@ -1,3 +1,4 @@ + # Order ## Properties @@ -7,7 +8,17 @@ Name | Type | Description | Notes **petId** | **Long** | | [optional] **quantity** | **Integer** | | [optional] **shipDate** | [**Date**](Date.md) | | [optional] -**status** | **String** | Order Status | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] **complete** | **Boolean** | | [optional] + +## Enum: StatusEnum +Name | Value +---- | ----- +PLACED | placed +APPROVED | approved +DELIVERED | delivered + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Pet.md b/samples/client/petstore/java/okhttp-gson/docs/Pet.md index 4676687984e..20a1c298dd6 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Pet.md @@ -1,3 +1,4 @@ + # Pet ## Properties @@ -8,6 +9,16 @@ Name | Type | Description | Notes **name** | **String** | | **photoUrls** | **List<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | available +PENDING | pending +SOLD | sold + diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index 1c97c809ca0..c8a34039885 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -54,7 +54,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -106,7 +106,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **byte[]**| Pet object in the form of byte array | [optional] + **body** | **byte[]**| Pet object in the form of byte array | [optional] ### Return type @@ -159,8 +159,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -266,7 +266,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [optional] + **tags** | [**List<String>**](String.md)| Tags to filter by | [optional] ### Return type @@ -325,7 +325,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -384,7 +384,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -443,7 +443,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be fetched | + **petId** | **Long**| ID of pet that needs to be fetched | ### Return type @@ -495,7 +495,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -549,9 +549,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **String**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] + **petId** | **String**| 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 @@ -605,9 +605,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md index e8ebae01a3b..c2c6117c552 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md @@ -1,3 +1,4 @@ + # SpecialModelName ## Properties @@ -6,3 +7,4 @@ Name | Type | Description | Notes **specialPropertyName** | **Long** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index 544081e5d68..b521b1a65ac 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -41,7 +41,7 @@ try { 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 | ### Return type @@ -102,7 +102,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **String**| Status value that needs to be considered for query | [optional] [default to placed] + **status** | **String**| Status value that needs to be considered for query | [optional] [default to placed] [enum: placed, approved, delivered] ### Return type @@ -265,7 +265,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of pet that needs to be fetched | + **orderId** | **String**| ID of pet that needs to be fetched | ### Return type @@ -326,7 +326,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] + **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/Tag.md b/samples/client/petstore/java/okhttp-gson/docs/Tag.md index cd4df387983..de6814b55d5 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Tag.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Tag.md @@ -1,3 +1,4 @@ + # Tag ## Properties @@ -7,3 +8,4 @@ Name | Type | Description | Notes **name** | **String** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/User.md b/samples/client/petstore/java/okhttp-gson/docs/User.md index b948c270267..8b6753dd284 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/User.md +++ b/samples/client/petstore/java/okhttp-gson/docs/User.md @@ -1,3 +1,4 @@ + # User ## Properties @@ -13,3 +14,4 @@ Name | Type | Description | Notes **userStatus** | **Integer** | User Status | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 571d547a079..3e1553c82c5 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | [optional] + **body** | [**User**](User.md)| Created user object | [optional] ### Return type @@ -87,7 +87,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | [optional] + **body** | [**List<User>**](User.md)| List of user object | [optional] ### Return type @@ -131,7 +131,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | [optional] + **body** | [**List<User>**](User.md)| List of user object | [optional] ### Return type @@ -184,7 +184,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | **String**| The name that needs to be deleted | ### Return type @@ -229,7 +229,7 @@ try { 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. | ### Return type @@ -275,8 +275,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [optional] - **password** | **String**| The password for login in clear text | [optional] + **username** | **String**| The user name for login | [optional] + **password** | **String**| The password for login in clear text | [optional] ### Return type @@ -361,8 +361,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | [optional] + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | [optional] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java new file mode 100644 index 00000000000..66fe7b115c4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -0,0 +1,69 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import com.google.gson.annotations.SerializedName; + + + + + +public class Animal { + + @SerializedName("className") + private String className = null; + + + + /** + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java new file mode 100644 index 00000000000..d26601a68f1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -0,0 +1,87 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.Animal; + +import com.google.gson.annotations.SerializedName; + + + + + +public class Cat extends Animal { + + @SerializedName("className") + private String className = null; + + @SerializedName("declawed") + private Boolean declawed = null; + + + + /** + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.className, cat.className) && + Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(className, declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java new file mode 100644 index 00000000000..031045d5fe7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -0,0 +1,87 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.Animal; + +import com.google.gson.annotations.SerializedName; + + + + + +public class Dog extends Animal { + + @SerializedName("className") + private String className = null; + + @SerializedName("breed") + private String breed = null; + + + + /** + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + **/ + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.className, dog.className) && + Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(className, breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}