diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache index a941843a5eb..fae7a93303d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache @@ -20,7 +20,7 @@ public interface {{classname}} extends ApiClient.Api { /** * {{summary}} * {{notes}} -{{#allParams}} * @param {{paramName}} {{description}} +{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}") diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache index 94be4298250..aa84768b47a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache @@ -23,7 +23,7 @@ public interface {{classname}} { * {{summary}} * Sync method * {{notes}} -{{#allParams}} * @param {{paramName}} {{description}} +{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ {{#formParams}}{{#-first}} @@ -36,7 +36,7 @@ public interface {{classname}} { /** * {{summary}} * Async method -{{#allParams}} * @param {{paramName}} {{description}} +{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @param cb callback method * @return void */ diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache index 51a24a9777a..9bd835a4a36 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -24,7 +24,7 @@ public interface {{classname}} { /** * {{summary}} * {{notes}} -{{#allParams}} * @param {{paramName}} {{description}} +{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @return Call<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> */ {{#formParams}}{{#-first}} diff --git a/modules/swagger-codegen/src/main/resources/perl/README.mustache b/modules/swagger-codegen/src/main/resources/perl/README.mustache index b7641ecea8c..185859ec4a3 100644 --- a/modules/swagger-codegen/src/main/resources/perl/README.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/README.mustache @@ -1,12 +1,12 @@ # NAME -{{moduleName}}::Role - a Moose role for the {{appName}} +{{moduleName}}::Role - a Moose role for the {{appName}} {{#appDescription}}{{{appDescription}}}{{/appDescription}} # VERSION -Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API verion: {{appVersion}} - Package version: {{moduleVersion}} @@ -253,14 +253,14 @@ use warnings; use Data::Dumper; {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} # Configure HTTP basic authorization: {{{name}}} -{{{moduleName}}}::Configuration::username = 'YOUR_USERNAME'; -{{{moduleName}}}::Configuration::password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}} +${{{moduleName}}}::Configuration::username = 'YOUR_USERNAME'; +${{{moduleName}}}::Configuration::password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}} # Configure API key authorization: {{{name}}} -{{{moduleName}}}::Configuration::api_key->{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; +${{{moduleName}}}::Configuration::api_key->{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#{{{moduleName}}}::Configuration::api_key_prefix->{'{{{keyParamName}}}'} = 'BEARER';{{/isApiKey}}{{#isOAuth}} +#${{{moduleName}}}::Configuration::api_key_prefix->{'{{{keyParamName}}}'} = 'BEARER';{{/isApiKey}}{{#isOAuth}} # Configure OAuth2 access token for authorization: {{{name}}} -{{{moduleName}}}::Configuration::access_token = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}} +${{{moduleName}}}::Configuration::access_token = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}} {{/hasAuthMethods}} my $api_instance = {{moduleName}}::{{classname}}->new(); diff --git a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache index 35ab8253532..eb270b7e216 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache @@ -27,14 +27,14 @@ Method | HTTP request | Description use Data::Dumper; {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} # Configure HTTP basic authorization: {{{name}}} -{{{moduleName}}}::Configuration::username = 'YOUR_USERNAME'; -{{{moduleName}}}::Configuration::password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}} +${{{moduleName}}}::Configuration::username = 'YOUR_USERNAME'; +${{{moduleName}}}::Configuration::password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}} # Configure API key authorization: {{{name}}} -{{{moduleName}}}::Configuration::api_key->{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; +${{{moduleName}}}::Configuration::api_key->{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#{{{moduleName}}}::Configuration::api_key_prefix->{'{{{keyParamName}}}'} = "BEARER";{{/isApiKey}}{{#isOAuth}} +#${{{moduleName}}}::Configuration::api_key_prefix->{'{{{keyParamName}}}'} = "BEARER";{{/isApiKey}}{{#isOAuth}} # Configure OAuth2 access token for authorization: {{{name}}} -{{{moduleName}}}::Configuration::access_token = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}} +${{{moduleName}}}::Configuration::access_token = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}} {{/hasAuthMethods}} my $api_instance = {{moduleName}}::{{classname}}->new(); diff --git a/samples/client/petstore/java/feign/.gitignore b/samples/client/petstore/java/feign/.gitignore new file mode 100644 index 00000000000..32858aad3c3 --- /dev/null +++ b/samples/client/petstore/java/feign/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/samples/client/petstore/java/feign/git_push.sh b/samples/client/petstore/java/feign/git_push.sh new file mode 100644 index 00000000000..1a36388db02 --- /dev/null +++ b/samples/client/petstore/java/feign/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 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="YOUR_GIT_USR_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="YOUR_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 crediential 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/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 70ce18f0569..51f6c2358c7 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -6,20 +6,23 @@ import io.swagger.client.model.Pet; import io.swagger.client.model.InlineResponse200; import java.io.File; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00") public interface PetApi extends ApiClient.Api { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return void */ @RequestLine("POST /pet") @@ -32,7 +35,7 @@ public interface PetApi extends ApiClient.Api { /** * Fake endpoint to test byte array in body parameter for adding a new pet to the store * - * @param body Pet object in the form of byte array + * @param body Pet object in the form of byte array (optional) * @return void */ @RequestLine("POST /pet?testing_byte_array=true") @@ -45,8 +48,8 @@ public interface PetApi extends ApiClient.Api { /** * Deletes a pet * - * @param petId Pet id to delete - * @param apiKey + * @param petId Pet id to delete (required) + * @param apiKey (optional) * @return void */ @RequestLine("DELETE /pet/{petId}") @@ -60,7 +63,7 @@ public interface PetApi extends ApiClient.Api { /** * Finds Pets by status * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for query + * @param status Status values that need to be considered for query (optional, default to available) * @return List */ @RequestLine("GET /pet/findByStatus?status={status}") @@ -73,7 +76,7 @@ public interface PetApi extends ApiClient.Api { /** * Finds Pets by tags * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by + * @param tags Tags to filter by (optional) * @return List */ @RequestLine("GET /pet/findByTags?tags={tags}") @@ -86,7 +89,7 @@ public interface PetApi extends ApiClient.Api { /** * Find pet by ID * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Pet */ @RequestLine("GET /pet/{petId}") @@ -99,7 +102,7 @@ public interface PetApi extends ApiClient.Api { /** * Fake endpoint to test inline arbitrary object return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return InlineResponse200 */ @RequestLine("GET /pet/{petId}?response=inline_arbitrary_object") @@ -112,7 +115,7 @@ public interface PetApi extends ApiClient.Api { /** * Fake endpoint to test byte array return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return byte[] */ @RequestLine("GET /pet/{petId}?testing_byte_array=true") @@ -125,7 +128,7 @@ public interface PetApi extends ApiClient.Api { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return void */ @RequestLine("PUT /pet") @@ -138,9 +141,9 @@ public interface PetApi extends ApiClient.Api { /** * 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 + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @return void */ @RequestLine("POST /pet/{petId}") @@ -153,9 +156,9 @@ public interface PetApi extends ApiClient.Api { /** * uploads an image * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @return void */ @RequestLine("POST /pet/{petId}/uploadImage") @@ -165,4 +168,5 @@ public interface PetApi extends ApiClient.Api { }) void uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file); + } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index c36d85e0b5a..97c3ad3ec16 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -4,20 +4,23 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00") public interface StoreApi extends ApiClient.Api { /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted + * @param orderId ID of the order that needs to be deleted (required) * @return void */ @RequestLine("DELETE /store/order/{orderId}") @@ -30,7 +33,7 @@ public interface StoreApi extends ApiClient.Api { /** * Finds orders by status * A single status value can be provided as a string - * @param status Status value that needs to be considered for query + * @param status Status value that needs to be considered for query (optional, default to placed) * @return List */ @RequestLine("GET /store/findByStatus?status={status}") @@ -67,7 +70,7 @@ public interface StoreApi extends ApiClient.Api { /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched + * @param orderId ID of pet that needs to be fetched (required) * @return Order */ @RequestLine("GET /store/order/{orderId}") @@ -80,7 +83,7 @@ public interface StoreApi extends ApiClient.Api { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param body order placed for purchasing the pet (optional) * @return Order */ @RequestLine("POST /store/order") @@ -90,4 +93,5 @@ public interface StoreApi extends ApiClient.Api { }) Order placeOrder(Order body); + } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index 082e9af7484..3fef00a41f0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -4,20 +4,23 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00") public interface UserApi extends ApiClient.Api { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param body Created user object (optional) * @return void */ @RequestLine("POST /user") @@ -30,7 +33,7 @@ public interface UserApi extends ApiClient.Api { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return void */ @RequestLine("POST /user/createWithArray") @@ -43,7 +46,7 @@ public interface UserApi extends ApiClient.Api { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return void */ @RequestLine("POST /user/createWithList") @@ -56,7 +59,7 @@ public interface UserApi extends ApiClient.Api { /** * Delete user * This can only be done by the logged in user. - * @param username The name that needs to be deleted + * @param username The name that needs to be deleted (required) * @return void */ @RequestLine("DELETE /user/{username}") @@ -69,7 +72,7 @@ public interface UserApi extends ApiClient.Api { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User */ @RequestLine("GET /user/{username}") @@ -82,8 +85,8 @@ public interface UserApi extends ApiClient.Api { /** * Logs user into the system * - * @param username The user name for login - * @param password The password for login in clear text + * @param username The user name for login (optional) + * @param password The password for login in clear text (optional) * @return String */ @RequestLine("GET /user/login?username={username}&password={password}") @@ -108,8 +111,8 @@ public interface UserApi extends ApiClient.Api { /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object + * @param username name that need to be deleted (required) + * @param body Updated user object (optional) * @return void */ @RequestLine("PUT /user/{username}") @@ -119,4 +122,5 @@ public interface UserApi extends ApiClient.Api { }) void updateUser(@Param("username") String username, User body); + } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java index 571e95aac8f..117d23f61f6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -13,12 +13,16 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-14T22:17:50.356+08:00") + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-19T15:53:31.820+08:00") public class InlineResponse200 { - private List tags = new ArrayList(); + private List photoUrls = new ArrayList(); + private String name = null; private Long id = null; private Object category = null; + private List tags = new ArrayList(); public enum StatusEnum { @@ -40,24 +44,39 @@ public class InlineResponse200 { } private StatusEnum status = null; - private String name = null; - private List photoUrls = new ArrayList(); /** **/ - public InlineResponse200 tags(List tags) { - this.tags = tags; + public InlineResponse200 photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") - public List getTags() { - return tags; + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; } - public void setTags(List tags) { - this.tags = tags; + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + /** + **/ + public InlineResponse200 name(String name) { + this.name = name; + return this; + } + + @ApiModelProperty(example = "doggie", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; } @@ -95,6 +114,23 @@ public class InlineResponse200 { } + /** + **/ + public InlineResponse200 tags(List tags) { + this.tags = tags; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** * pet status in the store **/ @@ -113,40 +149,6 @@ public class InlineResponse200 { } - /** - **/ - public InlineResponse200 name(String name) { - this.name = name; - return this; - } - - @ApiModelProperty(example = "doggie", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - /** - **/ - public InlineResponse200 photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("photoUrls") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - @Override public boolean equals(java.lang.Object o) { @@ -157,17 +159,17 @@ public class InlineResponse200 { return false; } InlineResponse200 inlineResponse200 = (InlineResponse200) o; - return Objects.equals(this.tags, inlineResponse200.tags) && + return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) && + Objects.equals(this.name, inlineResponse200.name) && Objects.equals(this.id, inlineResponse200.id) && Objects.equals(this.category, inlineResponse200.category) && - Objects.equals(this.status, inlineResponse200.status) && - Objects.equals(this.name, inlineResponse200.name) && - Objects.equals(this.photoUrls, inlineResponse200.photoUrls); + Objects.equals(this.tags, inlineResponse200.tags) && + Objects.equals(this.status, inlineResponse200.status); } @Override public int hashCode() { - return Objects.hash(tags, id, category, status, name, photoUrls); + return Objects.hash(photoUrls, name, id, category, tags, status); } @Override @@ -175,12 +177,12 @@ public class InlineResponse200 { StringBuilder sb = new StringBuilder(); sb.append("class InlineResponse200 {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append("}"); return sb.toString(); } @@ -197,3 +199,5 @@ public class InlineResponse200 { } } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java new file mode 100644 index 00000000000..882dd6017c9 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -0,0 +1,78 @@ +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-19T15:53:31.820+08:00") +public class Model200Response { + + private Integer name = null; + + + /** + **/ + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + public void setName(Integer 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; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(this.name, _200Response.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\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/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java new file mode 100644 index 00000000000..d4be9479686 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -0,0 +1,78 @@ +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-19T15:53:31.820+08:00") +public class ModelReturn { + + private Integer _return = null; + + + /** + **/ + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("return") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).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/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java new file mode 100644 index 00000000000..a10c13ef806 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -0,0 +1,98 @@ +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-19T15:53:31.820+08:00") +public class Name { + + private Integer name = null; + private Integer snakeCase = null; + + + /** + **/ + public Name name(Integer name) { + this.name = name; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + /** + **/ + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("snake_case") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).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/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java new file mode 100644 index 00000000000..254f9be4828 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -0,0 +1,78 @@ +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-19T15:53:31.820+08:00") +public class SpecialModelName { + + private Long specialPropertyName = null; + + + /** + **/ + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("$special[property.name]") + public Long getSpecialPropertyName() { + return specialPropertyName; + } + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash(specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).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/retrofit/.gitignore b/samples/client/petstore/java/retrofit/.gitignore new file mode 100644 index 00000000000..32858aad3c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/samples/client/petstore/java/retrofit/git_push.sh b/samples/client/petstore/java/retrofit/git_push.sh new file mode 100644 index 00000000000..1a36388db02 --- /dev/null +++ b/samples/client/petstore/java/retrofit/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 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="YOUR_GIT_USR_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="YOUR_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 crediential 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/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java index 08034d5c073..92147932bac 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java @@ -10,18 +10,22 @@ import io.swagger.client.model.Pet; import io.swagger.client.model.InlineResponse200; import java.io.File; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface PetApi { /** * Add a new pet to the store * Sync method * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return Void */ @@ -33,7 +37,7 @@ public interface PetApi { /** * Add a new pet to the store * Async method - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @param cb callback method * @return void */ @@ -47,7 +51,7 @@ public interface PetApi { * Fake endpoint to test byte array in body parameter for adding a new pet to the store * Sync method * - * @param body Pet object in the form of byte array + * @param body Pet object in the form of byte array (optional) * @return Void */ @@ -59,7 +63,7 @@ public interface PetApi { /** * Fake endpoint to test byte array in body parameter for adding a new pet to the store * Async method - * @param body Pet object in the form of byte array + * @param body Pet object in the form of byte array (optional) * @param cb callback method * @return void */ @@ -73,8 +77,8 @@ public interface PetApi { * Deletes a pet * Sync method * - * @param petId Pet id to delete - * @param apiKey + * @param petId Pet id to delete (required) + * @param apiKey (optional) * @return Void */ @@ -86,8 +90,8 @@ public interface PetApi { /** * Deletes a pet * Async method - * @param petId Pet id to delete - * @param apiKey + * @param petId Pet id to delete (required) + * @param apiKey (optional) * @param cb callback method * @return void */ @@ -101,7 +105,7 @@ public interface PetApi { * Finds Pets by status * Sync method * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for query + * @param status Status values that need to be considered for query (optional, default to available) * @return List */ @@ -113,7 +117,7 @@ public interface PetApi { /** * Finds Pets by status * Async method - * @param status Status values that need to be considered for query + * @param status Status values that need to be considered for query (optional, default to available) * @param cb callback method * @return void */ @@ -127,7 +131,7 @@ public interface PetApi { * Finds Pets by tags * Sync method * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by + * @param tags Tags to filter by (optional) * @return List */ @@ -139,7 +143,7 @@ public interface PetApi { /** * Finds Pets by tags * Async method - * @param tags Tags to filter by + * @param tags Tags to filter by (optional) * @param cb callback method * @return void */ @@ -153,7 +157,7 @@ public interface PetApi { * Find pet by ID * Sync method * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Pet */ @@ -165,7 +169,7 @@ public interface PetApi { /** * Find pet by ID * Async method - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @param cb callback method * @return void */ @@ -179,7 +183,7 @@ public interface PetApi { * Fake endpoint to test inline arbitrary object return by 'Find pet by ID' * Sync method * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return InlineResponse200 */ @@ -191,7 +195,7 @@ public interface PetApi { /** * Fake endpoint to test inline arbitrary object return by 'Find pet by ID' * Async method - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @param cb callback method * @return void */ @@ -205,7 +209,7 @@ public interface PetApi { * Fake endpoint to test byte array return by 'Find pet by ID' * Sync method * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return byte[] */ @@ -217,7 +221,7 @@ public interface PetApi { /** * Fake endpoint to test byte array return by 'Find pet by ID' * Async method - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @param cb callback method * @return void */ @@ -231,7 +235,7 @@ public interface PetApi { * Update an existing pet * Sync method * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return Void */ @@ -243,7 +247,7 @@ public interface PetApi { /** * Update an existing pet * Async method - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @param cb callback method * @return void */ @@ -257,9 +261,9 @@ public interface PetApi { * Updates a pet in the store with form data * Sync method * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @return Void */ @@ -272,9 +276,9 @@ public interface PetApi { /** * Updates a pet in the store with form data * Async method - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @param cb callback method * @return void */ @@ -289,9 +293,9 @@ public interface PetApi { * uploads an image * Sync method * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @return Void */ @@ -304,9 +308,9 @@ public interface PetApi { /** * uploads an image * Async method - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @param cb callback method * @return void */ @@ -318,3 +322,4 @@ public interface PetApi { ); } + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index 71fd1e8f8e6..815d067c967 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -8,18 +8,22 @@ import retrofit.mime.*; import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { /** * Delete purchase order by ID * Sync method * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted + * @param orderId ID of the order that needs to be deleted (required) * @return Void */ @@ -31,7 +35,7 @@ public interface StoreApi { /** * Delete purchase order by ID * Async method - * @param orderId ID of the order that needs to be deleted + * @param orderId ID of the order that needs to be deleted (required) * @param cb callback method * @return void */ @@ -45,7 +49,7 @@ public interface StoreApi { * Finds orders by status * Sync method * A single status value can be provided as a string - * @param status Status value that needs to be considered for query + * @param status Status value that needs to be considered for query (optional, default to placed) * @return List */ @@ -57,7 +61,7 @@ public interface StoreApi { /** * Finds orders by status * Async method - * @param status Status value that needs to be considered for query + * @param status Status value that needs to be considered for query (optional, default to placed) * @param cb callback method * @return void */ @@ -117,7 +121,7 @@ public interface StoreApi { * Find purchase order by ID * Sync method * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched + * @param orderId ID of pet that needs to be fetched (required) * @return Order */ @@ -129,7 +133,7 @@ public interface StoreApi { /** * Find purchase order by ID * Async method - * @param orderId ID of pet that needs to be fetched + * @param orderId ID of pet that needs to be fetched (required) * @param cb callback method * @return void */ @@ -143,7 +147,7 @@ public interface StoreApi { * Place an order for a pet * Sync method * - * @param body order placed for purchasing the pet + * @param body order placed for purchasing the pet (optional) * @return Order */ @@ -155,7 +159,7 @@ public interface StoreApi { /** * Place an order for a pet * Async method - * @param body order placed for purchasing the pet + * @param body order placed for purchasing the pet (optional) * @param cb callback method * @return void */ @@ -166,3 +170,4 @@ public interface StoreApi { ); } + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java index d72ac537669..a0d913e071f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java @@ -8,18 +8,22 @@ import retrofit.mime.*; import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface UserApi { /** * Create user * Sync method * This can only be done by the logged in user. - * @param body Created user object + * @param body Created user object (optional) * @return Void */ @@ -31,7 +35,7 @@ public interface UserApi { /** * Create user * Async method - * @param body Created user object + * @param body Created user object (optional) * @param cb callback method * @return void */ @@ -45,7 +49,7 @@ public interface UserApi { * Creates list of users with given input array * Sync method * - * @param body List of user object + * @param body List of user object (optional) * @return Void */ @@ -57,7 +61,7 @@ public interface UserApi { /** * Creates list of users with given input array * Async method - * @param body List of user object + * @param body List of user object (optional) * @param cb callback method * @return void */ @@ -71,7 +75,7 @@ public interface UserApi { * Creates list of users with given input array * Sync method * - * @param body List of user object + * @param body List of user object (optional) * @return Void */ @@ -83,7 +87,7 @@ public interface UserApi { /** * Creates list of users with given input array * Async method - * @param body List of user object + * @param body List of user object (optional) * @param cb callback method * @return void */ @@ -97,7 +101,7 @@ public interface UserApi { * Delete user * Sync method * This can only be done by the logged in user. - * @param username The name that needs to be deleted + * @param username The name that needs to be deleted (required) * @return Void */ @@ -109,7 +113,7 @@ public interface UserApi { /** * Delete user * Async method - * @param username The name that needs to be deleted + * @param username The name that needs to be deleted (required) * @param cb callback method * @return void */ @@ -123,7 +127,7 @@ public interface UserApi { * Get user by user name * Sync method * - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User */ @@ -135,7 +139,7 @@ public interface UserApi { /** * Get user by user name * Async method - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @param cb callback method * @return void */ @@ -149,8 +153,8 @@ public interface UserApi { * Logs user into the system * Sync method * - * @param username The user name for login - * @param password The password for login in clear text + * @param username The user name for login (optional) + * @param password The password for login in clear text (optional) * @return String */ @@ -162,8 +166,8 @@ public interface UserApi { /** * Logs user into the system * Async method - * @param username The user name for login - * @param password The password for login in clear text + * @param username The user name for login (optional) + * @param password The password for login in clear text (optional) * @param cb callback method * @return void */ @@ -200,8 +204,8 @@ public interface UserApi { * Updated user * Sync method * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object + * @param username name that need to be deleted (required) + * @param body Updated user object (optional) * @return Void */ @@ -213,8 +217,8 @@ public interface UserApi { /** * Updated user * Async method - * @param username name that need to be deleted - * @param body Updated user object + * @param username name that need to be deleted (required) + * @param body Updated user object (optional) * @param cb callback method * @return void */ @@ -225,3 +229,4 @@ public interface UserApi { ); } + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java index d0908afd9e1..67de63eb179 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Category { @SerializedName("id") @@ -83,3 +85,5 @@ public class Category { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/InlineResponse200.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/InlineResponse200.java index 4082b25c85c..165f069a05b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/InlineResponse200.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -7,16 +7,21 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class InlineResponse200 { - @SerializedName("tags") - private List tags = new ArrayList(); + @SerializedName("photoUrls") + private List photoUrls = new ArrayList(); + + @SerializedName("name") + private String name = null; @SerializedName("id") private Long id = null; @@ -24,6 +29,9 @@ public class InlineResponse200 { @SerializedName("category") private Object category = null; + @SerializedName("tags") + private List tags = new ArrayList(); + public enum StatusEnum { @SerializedName("available") @@ -50,22 +58,27 @@ public enum StatusEnum { @SerializedName("status") private StatusEnum status = null; - @SerializedName("name") - private String name = null; - - @SerializedName("photoUrls") - private List photoUrls = new ArrayList(); - /** **/ @ApiModelProperty(value = "") - public List getTags() { - return tags; + public List getPhotoUrls() { + return photoUrls; } - public void setTags(List tags) { - this.tags = tags; + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + /** + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; } @@ -91,6 +104,17 @@ public enum StatusEnum { } + /** + **/ + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** * pet status in the store **/ @@ -103,28 +127,6 @@ public enum StatusEnum { } - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - /** - **/ - @ApiModelProperty(value = "") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - @Override public boolean equals(Object o) { @@ -135,17 +137,17 @@ public enum StatusEnum { return false; } InlineResponse200 inlineResponse200 = (InlineResponse200) o; - return Objects.equals(tags, inlineResponse200.tags) && + return Objects.equals(photoUrls, inlineResponse200.photoUrls) && + Objects.equals(name, inlineResponse200.name) && Objects.equals(id, inlineResponse200.id) && Objects.equals(category, inlineResponse200.category) && - Objects.equals(status, inlineResponse200.status) && - Objects.equals(name, inlineResponse200.name) && - Objects.equals(photoUrls, inlineResponse200.photoUrls); + Objects.equals(tags, inlineResponse200.tags) && + Objects.equals(status, inlineResponse200.status); } @Override public int hashCode() { - return Objects.hash(tags, id, category, status, name, photoUrls); + return Objects.hash(photoUrls, name, id, category, tags, status); } @Override @@ -153,12 +155,12 @@ public enum StatusEnum { StringBuilder sb = new StringBuilder(); sb.append("class InlineResponse200 {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append("}"); return sb.toString(); } @@ -174,3 +176,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java new file mode 100644 index 00000000000..80b0aed92a8 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java @@ -0,0 +1,73 @@ +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 Model200Response { + + @SerializedName("name") + private Integer name = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(name, _200Response.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java new file mode 100644 index 00000000000..ce8c1238fdb --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java @@ -0,0 +1,73 @@ +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 ModelReturn { + + @SerializedName("return") + private Integer _return = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(_return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).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/retrofit/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java new file mode 100644 index 00000000000..370214bd21c --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java @@ -0,0 +1,89 @@ +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 Name { + + @SerializedName("name") + private Integer name = null; + + @SerializedName("snake_case") + private Integer snakeCase = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).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/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index c73230a4119..e601bd7a15a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Order { @SerializedName("id") @@ -169,3 +171,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index 0374eabfba4..5d1210dc55b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -8,12 +8,14 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Pet { @SerializedName("id") @@ -175,3 +177,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java new file mode 100644 index 00000000000..b5a96d5fc39 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -0,0 +1,73 @@ +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 SpecialModelName { + + @SerializedName("$special[property.name]") + private Long specialPropertyName = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Long getSpecialPropertyName() { + return specialPropertyName; + } + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash(specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).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/retrofit/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java index a4ca1074ca1..6ee49ee2166 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Tag { @SerializedName("id") @@ -83,3 +85,5 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java index 072f510081a..98196393ef1 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class User { @SerializedName("id") @@ -180,3 +182,5 @@ public class User { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/.gitignore b/samples/client/petstore/java/retrofit2/.gitignore new file mode 100644 index 00000000000..32858aad3c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/samples/client/petstore/java/retrofit2/git_push.sh b/samples/client/petstore/java/retrofit2/git_push.sh new file mode 100644 index 00000000000..1a36388db02 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/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 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="YOUR_GIT_USR_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="YOUR_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 crediential 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/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java index f3a541027c6..2cc69238a6b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java @@ -12,17 +12,21 @@ import io.swagger.client.model.Pet; import io.swagger.client.model.InlineResponse200; import java.io.File; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return Call */ @@ -35,7 +39,7 @@ public interface PetApi { /** * Fake endpoint to test byte array in body parameter for adding a new pet to the store * - * @param body Pet object in the form of byte array + * @param body Pet object in the form of byte array (optional) * @return Call */ @@ -48,8 +52,8 @@ public interface PetApi { /** * Deletes a pet * - * @param petId Pet id to delete - * @param apiKey + * @param petId Pet id to delete (required) + * @param apiKey (optional) * @return Call */ @@ -62,7 +66,7 @@ public interface PetApi { /** * Finds Pets by status * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for query + * @param status Status values that need to be considered for query (optional, default to available) * @return Call> */ @@ -75,7 +79,7 @@ public interface PetApi { /** * Finds Pets by tags * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by + * @param tags Tags to filter by (optional) * @return Call> */ @@ -88,7 +92,7 @@ public interface PetApi { /** * Find pet by ID * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -101,7 +105,7 @@ public interface PetApi { /** * Fake endpoint to test inline arbitrary object return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -114,7 +118,7 @@ public interface PetApi { /** * Fake endpoint to test byte array return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -127,7 +131,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return Call */ @@ -140,9 +144,9 @@ public interface PetApi { /** * 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 + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @return Call */ @@ -156,9 +160,9 @@ public interface PetApi { /** * uploads an image * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @return Call */ @@ -170,3 +174,4 @@ public interface PetApi { } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index 9883db98e4a..d023308c32e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -10,17 +10,21 @@ import okhttp3.RequestBody; import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted + * @param orderId ID of the order that needs to be deleted (required) * @return Call */ @@ -33,7 +37,7 @@ public interface StoreApi { /** * Finds orders by status * A single status value can be provided as a string - * @param status Status value that needs to be considered for query + * @param status Status value that needs to be considered for query (optional, default to placed) * @return Call> */ @@ -68,7 +72,7 @@ public interface StoreApi { /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched + * @param orderId ID of pet that needs to be fetched (required) * @return Call */ @@ -81,7 +85,7 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param body order placed for purchasing the pet (optional) * @return Call */ @@ -92,3 +96,4 @@ public interface StoreApi { } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java index f929ef1a38e..08aeb90a583 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java @@ -10,17 +10,21 @@ import okhttp3.RequestBody; import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param body Created user object (optional) * @return Call */ @@ -33,7 +37,7 @@ public interface UserApi { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return Call */ @@ -46,7 +50,7 @@ public interface UserApi { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return Call */ @@ -59,7 +63,7 @@ public interface UserApi { /** * Delete user * This can only be done by the logged in user. - * @param username The name that needs to be deleted + * @param username The name that needs to be deleted (required) * @return Call */ @@ -72,7 +76,7 @@ public interface UserApi { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Call */ @@ -85,8 +89,8 @@ public interface UserApi { /** * Logs user into the system * - * @param username The user name for login - * @param password The password for login in clear text + * @param username The user name for login (optional) + * @param password The password for login in clear text (optional) * @return Call */ @@ -110,8 +114,8 @@ public interface UserApi { /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object + * @param username name that need to be deleted (required) + * @param body Updated user object (optional) * @return Call */ @@ -122,3 +126,4 @@ public interface UserApi { } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java index d0908afd9e1..67de63eb179 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Category { @SerializedName("id") @@ -83,3 +85,5 @@ public class Category { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/InlineResponse200.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/InlineResponse200.java index 4082b25c85c..165f069a05b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/InlineResponse200.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -7,16 +7,21 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class InlineResponse200 { - @SerializedName("tags") - private List tags = new ArrayList(); + @SerializedName("photoUrls") + private List photoUrls = new ArrayList(); + + @SerializedName("name") + private String name = null; @SerializedName("id") private Long id = null; @@ -24,6 +29,9 @@ public class InlineResponse200 { @SerializedName("category") private Object category = null; + @SerializedName("tags") + private List tags = new ArrayList(); + public enum StatusEnum { @SerializedName("available") @@ -50,22 +58,27 @@ public enum StatusEnum { @SerializedName("status") private StatusEnum status = null; - @SerializedName("name") - private String name = null; - - @SerializedName("photoUrls") - private List photoUrls = new ArrayList(); - /** **/ @ApiModelProperty(value = "") - public List getTags() { - return tags; + public List getPhotoUrls() { + return photoUrls; } - public void setTags(List tags) { - this.tags = tags; + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + /** + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; } @@ -91,6 +104,17 @@ public enum StatusEnum { } + /** + **/ + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** * pet status in the store **/ @@ -103,28 +127,6 @@ public enum StatusEnum { } - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - /** - **/ - @ApiModelProperty(value = "") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - @Override public boolean equals(Object o) { @@ -135,17 +137,17 @@ public enum StatusEnum { return false; } InlineResponse200 inlineResponse200 = (InlineResponse200) o; - return Objects.equals(tags, inlineResponse200.tags) && + return Objects.equals(photoUrls, inlineResponse200.photoUrls) && + Objects.equals(name, inlineResponse200.name) && Objects.equals(id, inlineResponse200.id) && Objects.equals(category, inlineResponse200.category) && - Objects.equals(status, inlineResponse200.status) && - Objects.equals(name, inlineResponse200.name) && - Objects.equals(photoUrls, inlineResponse200.photoUrls); + Objects.equals(tags, inlineResponse200.tags) && + Objects.equals(status, inlineResponse200.status); } @Override public int hashCode() { - return Objects.hash(tags, id, category, status, name, photoUrls); + return Objects.hash(photoUrls, name, id, category, tags, status); } @Override @@ -153,12 +155,12 @@ public enum StatusEnum { StringBuilder sb = new StringBuilder(); sb.append("class InlineResponse200 {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append("}"); return sb.toString(); } @@ -174,3 +176,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java new file mode 100644 index 00000000000..80b0aed92a8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java @@ -0,0 +1,73 @@ +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 Model200Response { + + @SerializedName("name") + private Integer name = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(name, _200Response.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java new file mode 100644 index 00000000000..ce8c1238fdb --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -0,0 +1,73 @@ +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 ModelReturn { + + @SerializedName("return") + private Integer _return = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(_return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).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/retrofit2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java new file mode 100644 index 00000000000..370214bd21c --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java @@ -0,0 +1,89 @@ +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 Name { + + @SerializedName("name") + private Integer name = null; + + @SerializedName("snake_case") + private Integer snakeCase = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).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/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index c73230a4119..e601bd7a15a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Order { @SerializedName("id") @@ -169,3 +171,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index 0374eabfba4..5d1210dc55b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -8,12 +8,14 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Pet { @SerializedName("id") @@ -175,3 +177,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java index 1174ba6092c..b5a96d5fc39 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class SpecialModelName { @SerializedName("$special[property.name]") @@ -67,3 +69,5 @@ public class SpecialModelName { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java index a4ca1074ca1..6ee49ee2166 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Tag { @SerializedName("id") @@ -83,3 +85,5 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java index 072f510081a..98196393ef1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class User { @SerializedName("id") @@ -180,3 +182,5 @@ public class User { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/.gitignore b/samples/client/petstore/java/retrofit2rx/.gitignore new file mode 100644 index 00000000000..32858aad3c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/samples/client/petstore/java/retrofit2rx/git_push.sh b/samples/client/petstore/java/retrofit2rx/git_push.sh new file mode 100644 index 00000000000..1a36388db02 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/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 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="YOUR_GIT_USR_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="YOUR_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 crediential 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/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java index 220f4b91da0..33d4760a605 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java @@ -9,33 +9,24 @@ import retrofit2.http.*; import okhttp3.RequestBody; import io.swagger.client.model.Pet; -import java.io.File; import io.swagger.client.model.InlineResponse200; +import java.io.File; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -public interface PetApi { - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return Call - */ - - @PUT("pet") - Observable updatePet( - @Body Pet body - ); + +public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store (optional) * @return Call */ @@ -45,10 +36,37 @@ public interface PetApi { ); + /** + * Fake endpoint to test byte array in body parameter for adding a new pet to the store + * + * @param body Pet object in the form of byte array (optional) + * @return Call + */ + + @POST("pet?testing_byte_array=true") + Observable addPetUsingByteArray( + @Body byte[] body + ); + + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call + */ + + @DELETE("pet/{petId}") + Observable deletePet( + @Path("petId") Long petId, @Header("api_key") String apiKey + ); + + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for query + * @param status Status values that need to be considered for query (optional, default to available) * @return Call> */ @@ -61,7 +79,7 @@ public interface PetApi { /** * Finds Pets by tags * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by + * @param tags Tags to filter by (optional) * @return Call> */ @@ -74,7 +92,7 @@ public interface PetApi { /** * Find pet by ID * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -84,56 +102,10 @@ public interface PetApi { ); - /** - * 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 - * @return Call - */ - - @FormUrlEncoded - @POST("pet/{petId}") - Observable updatePetWithForm( - @Path("petId") String petId, @Field("name") String name, @Field("status") String status - ); - - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey - * @return Call - */ - - @DELETE("pet/{petId}") - Observable deletePet( - @Path("petId") Long petId, @Header("api_key") String apiKey - ); - - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return Call - */ - - @Multipart - @POST("pet/{petId}/uploadImage") - Observable uploadFile( - @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file - ); - - /** * Fake endpoint to test inline arbitrary object return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -146,7 +118,7 @@ public interface PetApi { /** * Fake endpoint to test byte array return by 'Find pet by ID' * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet that needs to be fetched (required) * @return Call */ @@ -157,16 +129,49 @@ public interface PetApi { /** - * Fake endpoint to test byte array in body parameter for adding a new pet to the store + * Update an existing pet * - * @param body Pet object in the form of byte array + * @param body Pet object that needs to be added to the store (optional) * @return Call */ - @POST("pet?testing_byte_array=true") - Observable addPetUsingByteArray( - @Body byte[] body + @PUT("pet") + Observable updatePet( + @Body Pet body + ); + + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Call + */ + + @FormUrlEncoded + @POST("pet/{petId}") + Observable updatePetWithForm( + @Path("petId") String petId, @Field("name") String name, @Field("status") String status + ); + + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return Call + */ + + @Multipart + @POST("pet/{petId}/uploadImage") + Observable uploadFile( + @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file ); } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java index 622ed81f15b..b4effc010df 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java @@ -10,17 +10,34 @@ import okhttp3.RequestBody; import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call + */ + + @DELETE("store/order/{orderId}") + Observable deleteOrder( + @Path("orderId") String orderId + ); + + /** * Finds orders by status * A single status value can be provided as a string - * @param status Status value that needs to be considered for query + * @param status Status value that needs to be considered for query (optional, default to placed) * @return Call> */ @@ -52,23 +69,10 @@ public interface StoreApi { - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Call - */ - - @POST("store/order") - Observable placeOrder( - @Body Order body - ); - - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched + * @param orderId ID of pet that needs to be fetched (required) * @return Call */ @@ -79,16 +83,17 @@ public interface StoreApi { /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return Call + * Place an order for a pet + * + * @param body order placed for purchasing the pet (optional) + * @return Call */ - @DELETE("store/order/{orderId}") - Observable deleteOrder( - @Path("orderId") String orderId + @POST("store/order") + Observable placeOrder( + @Body Order body ); } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java index 935d9ff4383..6019e10711d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java @@ -10,17 +10,21 @@ import okhttp3.RequestBody; import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param body Created user object (optional) * @return Call */ @@ -33,7 +37,7 @@ public interface UserApi { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return Call */ @@ -46,7 +50,7 @@ public interface UserApi { /** * Creates list of users with given input array * - * @param body List of user object + * @param body List of user object (optional) * @return Call */ @@ -56,11 +60,37 @@ public interface UserApi { ); + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call + */ + + @DELETE("user/{username}") + Observable deleteUser( + @Path("username") String username + ); + + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call + */ + + @GET("user/{username}") + Observable getUserByName( + @Path("username") String username + ); + + /** * Logs user into the system * - * @param username The user name for login - * @param password The password for login in clear text + * @param username The user name for login (optional) + * @param password The password for login in clear text (optional) * @return Call */ @@ -81,24 +111,11 @@ public interface UserApi { - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return Call - */ - - @GET("user/{username}") - Observable getUserByName( - @Path("username") String username - ); - - /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object + * @param username name that need to be deleted (required) + * @param body Updated user object (optional) * @return Call */ @@ -108,17 +125,5 @@ public interface UserApi { ); - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return Call - */ - - @DELETE("user/{username}") - Observable deleteUser( - @Path("username") String username - ); - - } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java index d0908afd9e1..67de63eb179 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Category { @SerializedName("id") @@ -83,3 +85,5 @@ public class Category { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/InlineResponse200.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/InlineResponse200.java index d687ab7d83c..165f069a05b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/InlineResponse200.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -7,12 +7,14 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class InlineResponse200 { @SerializedName("photoUrls") @@ -174,3 +176,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java new file mode 100644 index 00000000000..80b0aed92a8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java @@ -0,0 +1,73 @@ +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 Model200Response { + + @SerializedName("name") + private Integer name = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(name, _200Response.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java new file mode 100644 index 00000000000..ce8c1238fdb --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -0,0 +1,73 @@ +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 ModelReturn { + + @SerializedName("return") + private Integer _return = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(_return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).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/retrofit2rx/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java new file mode 100644 index 00000000000..370214bd21c --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java @@ -0,0 +1,89 @@ +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 Name { + + @SerializedName("name") + private Integer name = null; + + @SerializedName("snake_case") + private Integer snakeCase = null; + + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + + /** + **/ + @ApiModelProperty(value = "") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).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/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index c73230a4119..e601bd7a15a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -5,12 +5,14 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Order { @SerializedName("id") @@ -169,3 +171,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index 0374eabfba4..5d1210dc55b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -8,12 +8,14 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Pet { @SerializedName("id") @@ -175,3 +177,5 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java index 1174ba6092c..b5a96d5fc39 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class SpecialModelName { @SerializedName("$special[property.name]") @@ -67,3 +69,5 @@ public class SpecialModelName { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java index a4ca1074ca1..6ee49ee2166 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class Tag { @SerializedName("id") @@ -83,3 +85,5 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java index 072f510081a..98196393ef1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java @@ -4,12 +4,14 @@ import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import com.google.gson.annotations.SerializedName; -@ApiModel(description = "") + + public class User { @SerializedName("id") @@ -180,3 +182,5 @@ public class User { return o.toString().replace("\n", "\n "); } } + + diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 6ebfc0dcb76..138e62684ab 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -1,16 +1,16 @@ # NAME -WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore +WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters # VERSION -Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API verion: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-03-19T16:59:31.367+08:00 +- Build date: 2016-03-19T17:46:21.048+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen ## A note on Moose @@ -272,7 +272,7 @@ use WWW::SwaggerClient::Object::User; use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index 608af63073d..971dc0772c8 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -34,7 +34,7 @@ Add a new pet to the store use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store @@ -80,7 +80,7 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::string->new(); # string | Pet object in the form of byte array @@ -126,7 +126,7 @@ Deletes a pet use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # int | Pet id to delete @@ -174,7 +174,7 @@ Multiple status values can be provided with comma separated strings use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $status = (); # ARRAY[string] | Status values that need to be considered for query @@ -221,7 +221,7 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $tags = (); # ARRAY[string] | Tags to filter by @@ -268,11 +268,11 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond use Data::Dumper; # Configure API key authorization: api_key -WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # int | ID of pet that needs to be fetched @@ -319,11 +319,11 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond use Data::Dumper; # Configure API key authorization: api_key -WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # int | ID of pet that needs to be fetched @@ -370,11 +370,11 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond use Data::Dumper; # Configure API key authorization: api_key -WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # int | ID of pet that needs to be fetched @@ -421,7 +421,7 @@ Update an existing pet use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store @@ -467,7 +467,7 @@ Updates a pet in the store with form data use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 'pet_id_example'; # string | ID of pet that needs to be updated @@ -517,7 +517,7 @@ uploads an image use Data::Dumper; # Configure OAuth2 access token for authorization: petstore_auth -WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # int | ID of pet to update diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 9364b725364..7b9e35c977d 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -72,13 +72,13 @@ A single status value can be provided as a string use Data::Dumper; # Configure API key authorization: test_api_client_id -WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; # Configure API key authorization: test_api_client_secret -WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; my $api_instance = WWW::SwaggerClient::StoreApi->new(); my $status = 'status_example'; # string | Status value that needs to be considered for query @@ -125,9 +125,9 @@ Returns a map of status codes to quantities use Data::Dumper; # Configure API key authorization: api_key -WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; my $api_instance = WWW::SwaggerClient::StoreApi->new(); @@ -170,9 +170,9 @@ Returns an arbitrary object which is actually a map of status codes to quantitie use Data::Dumper; # Configure API key authorization: api_key -WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER"; my $api_instance = WWW::SwaggerClient::StoreApi->new(); @@ -215,13 +215,13 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge use Data::Dumper; # Configure API key authorization: test_api_key_header -WWW::SwaggerClient::Configuration::api_key->{'test_api_key_header'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_header'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_header'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_header'} = "BEARER"; # Configure API key authorization: test_api_key_query -WWW::SwaggerClient::Configuration::api_key->{'test_api_key_query'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_query'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_query'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_query'} = "BEARER"; my $api_instance = WWW::SwaggerClient::StoreApi->new(); my $order_id = 'order_id_example'; # string | ID of pet that needs to be fetched @@ -268,13 +268,13 @@ Place an order for a pet use Data::Dumper; # Configure API key authorization: test_api_client_id -WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; # Configure API key authorization: test_api_client_secret -WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; +$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; # uncomment below to setup prefix (e.g. BEARER) for API key, if needed -#WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; my $api_instance = WWW::SwaggerClient::StoreApi->new(); my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 204b42d9cb3..7330c1b3980 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -160,8 +160,8 @@ This can only be done by the logged in user. use Data::Dumper; # Configure HTTP basic authorization: test_http_basic -WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME'; -WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD'; +$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME'; +$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD'; my $api_instance = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # string | The name that needs to be deleted diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 0b3e7bd5de7..15fb410e8a5 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-19T16:59:31.367+08:00', + generated_date => '2016-03-19T17:46:21.048+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-19T16:59:31.367+08:00 +=item Build date: 2016-03-19T17:46:21.048+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen