From 0e1460fc228a37abaf081effc7bb52bf845af169 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 11 Feb 2017 22:47:07 +0800 Subject: [PATCH 001/132] show travis master status --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9a4b63a596..935603c9c5c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Swagger Code Generator -[![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) +[![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) From 1d52c62565c1d5bf0f6360882f37f8e9dbc7bdc2 Mon Sep 17 00:00:00 2001 From: Matthew Davis Date: Sat, 11 Feb 2017 06:50:12 -0800 Subject: [PATCH 002/132] Added Fotition as a company using swagger-codegen (#4773) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 935603c9c5c..40767c2b202 100644 --- a/README.md +++ b/README.md @@ -849,6 +849,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) +- [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [Germin8](http://www.germin8.com) - [goTransverse](http://www.gotransverse.com/api) From a956966ff2f2b9cd4eceaf2383bf88f66c803e2e Mon Sep 17 00:00:00 2001 From: BastiOfBerlin Date: Mon, 13 Feb 2017 11:03:48 +0100 Subject: [PATCH 003/132] Update gitignore (#4767) ignore dist folder --- .../src/main/resources/typescript-angular2/gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore b/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore index 35e2fb2b02e..149b5765472 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist From 74da89c6ac2517ea086d22a4d1d957f1f82aff12 Mon Sep 17 00:00:00 2001 From: Clem Date: Mon, 13 Feb 2017 11:07:00 +0100 Subject: [PATCH 004/132] Fix issue when the swagger model contains an 'Object' class (#4695) If the swagger model contains a class named 'Object' some mustache templates will generate non compiling **Java** code. --- .../src/main/resources/JavaInflector/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/cxf/pojo.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/spec/pojo.mustache | 4 ++-- .../swagger-codegen/src/main/resources/undertow/pojo.mustache | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache index 56869755b79..d5d57bc6910 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache @@ -47,7 +47,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -79,7 +79,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 93f920d4d12..04a5b76ea45 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -37,7 +37,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -69,7 +69,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 09c8fc1fecc..c071a0d9c80 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -94,7 +94,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 4c84bc6e6a0..612767afd14 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -29,7 +29,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -61,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache index 51090c995e1..4d43b69319c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -33,7 +33,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache index e63ecfe2f47..69dce348fe3 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache @@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } From 8f2e9bce6deb6ada27e331525d5f50c75c36f80b Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Feb 2017 18:53:34 +0800 Subject: [PATCH 005/132] remove trailing whitespaces in java api client (#4784) --- .../Java/libraries/feign/ApiClient.mustache | 24 +++++++++++++------ .../libraries/retrofit/ApiClient.mustache | 23 ++++++++++++------ .../libraries/retrofit2/ApiClient.mustache | 24 +++++++++++++------ .../java/io/swagger/client/ApiClient.java | 8 +++---- .../java/io/swagger/client/ApiClient.java | 10 ++++---- .../java/io/swagger/client/ApiClient.java | 8 +++---- .../java/io/swagger/client/ApiClient.java | 8 +++---- 7 files changed, 68 insertions(+), 37 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache index d33a86763ff..17d0e96f313 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -45,17 +45,27 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { {{#hasAuthMethods}} + for(String authName : authNames) { + {{#hasAuthMethods}} RequestInterceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} - auth = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");{{/isOAuth}} + {{#authMethods}}if ("{{name}}".equals(authName)) { + {{#isBasic}} + auth = new HttpBasicAuth(); + {{/isBasic}} + {{#isApiKey}} + auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"); + {{/isApiKey}} + {{#isOAuth}} + auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}"); + {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth);{{/hasAuthMethods}}{{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");{{/hasAuthMethods}} + addAuthorization(authName, auth); + {{/hasAuthMethods}} + {{^hasAuthMethods}} + throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); + {{/hasAuthMethods}} } } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache index 30de5917a34..7c45e926bcf 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache @@ -52,17 +52,26 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { {{#hasAuthMethods}} + for(String authName : authNames) { + {{#hasAuthMethods}} Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} - auth = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");{{/isOAuth}} + {{#authMethods}}if ("{{name}}".equals(authName)) { + {{#isBasic}} + auth = new HttpBasicAuth(); + {{/isBasic}} + {{#isApiKey}} + auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}} + {{#isOAuth}} + auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}"); + {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth);{{/hasAuthMethods}}{{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");{{/hasAuthMethods}} + addAuthorization(authName, auth); + {{/hasAuthMethods}} + {{^hasAuthMethods}} + throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); + {{/hasAuthMethods}} } } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 191b689c8c8..cc6b993e6ab 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -58,17 +58,27 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { {{#hasAuthMethods}} + for(String authName : authNames) { + {{#hasAuthMethods}} Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} - auth = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");{{/isOAuth}} + {{#authMethods}}if ("{{name}}".equals(authName)) { + {{#isBasic}} + auth = new HttpBasicAuth(); + {{/isBasic}} + {{#isApiKey}} + auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"); + {{/isApiKey}} + {{#isOAuth}} + auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}"); + {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth);{{/hasAuthMethods}}{{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");{{/hasAuthMethods}} + addAuthorization(authName, auth); + {{/hasAuthMethods}} + {{^hasAuthMethods}} + throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); + {{/hasAuthMethods}} } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java index 90c60875979..51483828c52 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java @@ -40,13 +40,13 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { RequestInterceptor auth; - if ("api_key".equals(authName)) { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if ("http_basic_test".equals(authName)) { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if ("petstore_auth".equals(authName)) { + } else if ("petstore_auth".equals(authName)) { auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java index ed9821db8f7..250c8f9550a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java @@ -52,13 +52,15 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { Interceptor auth; - if ("api_key".equals(authName)) { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if ("http_basic_test".equals(authName)) { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if ("petstore_auth".equals(authName)) { + + } else if ("petstore_auth".equals(authName)) { + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java index 4be862d52ff..99586dcab59 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java @@ -51,13 +51,13 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { Interceptor auth; - if ("api_key".equals(authName)) { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if ("http_basic_test".equals(authName)) { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if ("petstore_auth".equals(authName)) { + } else if ("petstore_auth".equals(authName)) { auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java index d3eb060514f..e3436cf56d0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java @@ -51,13 +51,13 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { Interceptor auth; - if (authName == "api_key") { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if (authName == "http_basic_test") { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if (authName == "petstore_auth") { + } else if ("petstore_auth".equals(authName)) { auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); From 9cf147f21572d25a2ea46a08a2e758bc52d72f78 Mon Sep 17 00:00:00 2001 From: Sreenidhi Sreesha Date: Mon, 13 Feb 2017 03:45:42 -0800 Subject: [PATCH 006/132] [Java] Change Boolean fields of CodegenParameter and CodegenResponse to boolean. (#4747) CodegenOperation and CodegenProperty classes have boolean fields instead of Boolean. This fix changes Boolean fields of CodegenParameter and CodegenResponse to boolean as well. Boolean fields are not necessary. Other classes interacting with them have to check for null before interacting with them which is unnecessary and leads to ugly code. --- .../io/swagger/codegen/CodegenParameter.java | 141 +++++++++--------- .../io/swagger/codegen/CodegenResponse.java | 52 +++---- .../io/swagger/codegen/DefaultCodegen.java | 14 +- .../languages/HaskellServantCodegen.java | 4 +- .../languages/JavascriptClientCodegen.java | 4 +- .../codegen/languages/RubyClientCodegen.java | 2 +- .../languages/StaticHtml2Generator.java | 2 +- .../java/io/swagger/codegen/CodegenTest.java | 12 +- 8 files changed, 113 insertions(+), 118 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index 3a0db92c5a4..e30159f9553 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -6,28 +6,29 @@ import java.util.Map; import java.util.List; public class CodegenParameter { - public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, + public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType; - public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName; + public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, + collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName; public String example; // example value (x-example) public String jsonSchema; - public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; - public Boolean isListContainer, isMapContainer; - public Boolean isFile, notFile; + public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; + public boolean isListContainer, isMapContainer; + public boolean isFile, notFile; public boolean isEnum; public List _enum; public Map allowableValues; public CodegenProperty items; public Map vendorExtensions; - public Boolean hasValidation; + public boolean hasValidation; /** * Determines whether this parameter is mandatory. If the parameter is in "path", * this property is required and its value MUST be true. Otherwise, the property * MAY be included and its default value is false. */ - public Boolean required; + public boolean required; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor17. @@ -36,7 +37,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor17 */ - public Boolean exclusiveMaximum; + public boolean exclusiveMaximum; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor21 */ @@ -44,7 +45,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor21 */ - public Boolean exclusiveMinimum; + public boolean exclusiveMinimum; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor26 */ @@ -68,7 +69,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor49 */ - public Boolean uniqueItems; + public boolean uniqueItems; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor14 */ @@ -156,27 +157,27 @@ public class CodegenParameter { CodegenParameter that = (CodegenParameter) o; if (isEnum != that.isEnum) return false; - if (isFormParam != null ? !isFormParam.equals(that.isFormParam) : that.isFormParam != null) + if (isFormParam != that.isFormParam) return false; - if (isQueryParam != null ? !isQueryParam.equals(that.isQueryParam) : that.isQueryParam != null) + if (isQueryParam != that.isQueryParam) return false; - if (isPathParam != null ? !isPathParam.equals(that.isPathParam) : that.isPathParam != null) + if (isPathParam != that.isPathParam) return false; - if (isHeaderParam != null ? !isHeaderParam.equals(that.isHeaderParam) : that.isHeaderParam != null) + if (isHeaderParam != that.isHeaderParam) return false; - if (isCookieParam != null ? !isCookieParam.equals(that.isCookieParam) : that.isCookieParam != null) + if (isCookieParam != that.isCookieParam) return false; - if (isBodyParam != null ? !isBodyParam.equals(that.isBodyParam) : that.isBodyParam != null) + if (isBodyParam != that.isBodyParam) return false; - if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null) + if (hasMore != that.hasMore) return false; - if (isContainer != null ? !isContainer.equals(that.isContainer) : that.isContainer != null) + if (isContainer != that.isContainer) return false; - if (secondaryParam != null ? !secondaryParam.equals(that.secondaryParam) : that.secondaryParam != null) + if (secondaryParam != that.secondaryParam) return false; - if (isCollectionFormatMulti != null ? !isCollectionFormatMulti.equals(that.isCollectionFormatMulti) : that.isCollectionFormatMulti != null) + if (isCollectionFormatMulti != that.isCollectionFormatMulti) return false; - if (isPrimitiveType != null ? !isPrimitiveType.equals(that.isPrimitiveType) : that.isPrimitiveType != null) + if (isPrimitiveType != that.isPrimitiveType) return false; if (baseName != null ? !baseName.equals(that.baseName) : that.baseName != null) return false; @@ -204,33 +205,33 @@ public class CodegenParameter { return false; if (jsonSchema != null ? !jsonSchema.equals(that.jsonSchema) : that.jsonSchema != null) return false; - if (isString != null ? !isString.equals(that.isString) : that.isString != null) + if (isString != that.isString) return false; - if (isInteger != null ? !isInteger.equals(that.isInteger) : that.isInteger != null) + if (isInteger != that.isInteger) return false; - if (isLong != null ? !isLong.equals(that.isLong) : that.isLong != null) + if (isLong != that.isLong) return false; - if (isFloat != null ? !isFloat.equals(that.isFloat) : that.isFloat != null) + if (isFloat != that.isFloat) return false; - if (isDouble != null ? !isDouble.equals(that.isDouble) : that.isDouble != null) + if (isDouble != that.isDouble) return false; - if (isByteArray != null ? !isByteArray.equals(that.isByteArray) : that.isByteArray != null) + if (isByteArray != that.isByteArray) return false; - if (isBinary != null ? !isBinary.equals(that.isBinary) : that.isBinary != null) + if (isBinary != that.isBinary) return false; - if (isBoolean != null ? !isBoolean.equals(that.isBoolean) : that.isBoolean != null) + if (isBoolean != that.isBoolean) return false; - if (isDate != null ? !isDate.equals(that.isDate) : that.isDate != null) + if (isDate != that.isDate) return false; - if (isDateTime != null ? !isDateTime.equals(that.isDateTime) : that.isDateTime != null) + if (isDateTime != that.isDateTime) return false; - if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null) + if (isListContainer != that.isListContainer) return false; - if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null) + if (isMapContainer != that.isMapContainer) return false; - if (isFile != null ? !isFile.equals(that.isFile) : that.isFile != null) + if (isFile != that.isFile) return false; - if (notFile != null ? !notFile.equals(that.notFile) : that.notFile != null) + if (notFile != that.notFile) return false; if (_enum != null ? !_enum.equals(that._enum) : that._enum != null) return false; @@ -240,17 +241,17 @@ public class CodegenParameter { return false; if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null) return false; - if (hasValidation != null ? !hasValidation.equals(that.hasValidation) : that.hasValidation != null) + if (hasValidation != that.hasValidation) return false; - if (required != null ? !required.equals(that.required) : that.required != null) + if (required != that.required) return false; if (maximum != null ? !maximum.equals(that.maximum) : that.maximum != null) return false; - if (exclusiveMaximum != null ? !exclusiveMaximum.equals(that.exclusiveMaximum) : that.exclusiveMaximum != null) + if (exclusiveMaximum != that.exclusiveMaximum) return false; if (minimum != null ? !minimum.equals(that.minimum) : that.minimum != null) return false; - if (exclusiveMinimum != null ? !exclusiveMinimum.equals(that.exclusiveMinimum) : that.exclusiveMinimum != null) + if (exclusiveMinimum != that.exclusiveMinimum) return false; if (maxLength != null ? !maxLength.equals(that.maxLength) : that.maxLength != null) return false; @@ -262,7 +263,7 @@ public class CodegenParameter { return false; if (minItems != null ? !minItems.equals(that.minItems) : that.minItems != null) return false; - if (uniqueItems != null ? !uniqueItems.equals(that.uniqueItems) : that.uniqueItems != null) + if (uniqueItems != that.uniqueItems) return false; return multipleOf != null ? multipleOf.equals(that.multipleOf) : that.multipleOf == null; @@ -270,17 +271,17 @@ public class CodegenParameter { @Override public int hashCode() { - int result = isFormParam != null ? isFormParam.hashCode() : 0; - result = 31 * result + (isQueryParam != null ? isQueryParam.hashCode() : 0); - result = 31 * result + (isPathParam != null ? isPathParam.hashCode() : 0); - result = 31 * result + (isHeaderParam != null ? isHeaderParam.hashCode() : 0); - result = 31 * result + (isCookieParam != null ? isCookieParam.hashCode() : 0); - result = 31 * result + (isBodyParam != null ? isBodyParam.hashCode() : 0); - result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0); - result = 31 * result + (isContainer != null ? isContainer.hashCode() : 0); - result = 31 * result + (secondaryParam != null ? secondaryParam.hashCode() : 0); - result = 31 * result + (isCollectionFormatMulti != null ? isCollectionFormatMulti.hashCode() : 0); - result = 31 * result + (isPrimitiveType != null ? isPrimitiveType.hashCode() : 0); + int result = isFormParam ? 13:31; + result = 31 * result + (isQueryParam ? 13:31); + result = 31 * result + (isPathParam ? 13:31); + result = 31 * result + (isHeaderParam ? 13:31); + result = 31 * result + (isCookieParam ? 13:31); + result = 31 * result + (isBodyParam ? 13:31); + result = 31 * result + (hasMore ? 13:31); + result = 31 * result + (isContainer ? 13:31); + result = 31 * result + (secondaryParam ? 13:31); + result = 31 * result + (isCollectionFormatMulti ? 13:31); + result = 31 * result + (isPrimitiveType ? 13:31); result = 31 * result + (baseName != null ? baseName.hashCode() : 0); result = 31 * result + (paramName != null ? paramName.hashCode() : 0); result = 31 * result + (dataType != null ? dataType.hashCode() : 0); @@ -294,37 +295,37 @@ public class CodegenParameter { result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0); result = 31 * result + (example != null ? example.hashCode() : 0); result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0); - result = 31 * result + (isString != null ? isString.hashCode() : 0); - result = 31 * result + (isInteger != null ? isInteger.hashCode() : 0); - result = 31 * result + (isLong != null ? isLong.hashCode() : 0); - result = 31 * result + (isFloat != null ? isFloat.hashCode() : 0); - result = 31 * result + (isDouble != null ? isDouble.hashCode() : 0); - result = 31 * result + (isByteArray != null ? isByteArray.hashCode() : 0); - result = 31 * result + (isBinary != null ? isBinary.hashCode() : 0); - result = 31 * result + (isBoolean != null ? isBoolean.hashCode() : 0); - result = 31 * result + (isDate != null ? isDate.hashCode() : 0); - result = 31 * result + (isDateTime != null ? isDateTime.hashCode() : 0); - result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0); - result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0); - result = 31 * result + (isFile != null ? isFile.hashCode() : 0); - result = 31 * result + (notFile != null ? notFile.hashCode() : 0); + result = 31 * result + (isString ? 13:31); + result = 31 * result + (isInteger ? 13:31); + result = 31 * result + (isLong ? 13:31); + result = 31 * result + (isFloat ? 13:31); + result = 31 * result + (isDouble ? 13:31); + result = 31 * result + (isByteArray ? 13:31); + result = 31 * result + (isBinary ? 13:31); + result = 31 * result + (isBoolean ? 13:31); + result = 31 * result + (isDate ? 13:31); + result = 31 * result + (isDateTime ? 13:31); + result = 31 * result + (isListContainer ? 13:31); + result = 31 * result + (isMapContainer ? 13:31); + result = 31 * result + (isFile ? 13:31); + result = 31 * result + (notFile ? 13:31); result = 31 * result + (isEnum ? 1 : 0); result = 31 * result + (_enum != null ? _enum.hashCode() : 0); result = 31 * result + (allowableValues != null ? allowableValues.hashCode() : 0); result = 31 * result + (items != null ? items.hashCode() : 0); result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0); - result = 31 * result + (hasValidation != null ? hasValidation.hashCode() : 0); - result = 31 * result + (required != null ? required.hashCode() : 0); + result = 31 * result + (hasValidation ? 13:31); + result = 31 * result + (required ? 13:31); result = 31 * result + (maximum != null ? maximum.hashCode() : 0); - result = 31 * result + (exclusiveMaximum != null ? exclusiveMaximum.hashCode() : 0); + result = 31 * result + (exclusiveMaximum ? 13:31); result = 31 * result + (minimum != null ? minimum.hashCode() : 0); - result = 31 * result + (exclusiveMinimum != null ? exclusiveMinimum.hashCode() : 0); + result = 31 * result + (exclusiveMinimum ? 13:31); result = 31 * result + (maxLength != null ? maxLength.hashCode() : 0); result = 31 * result + (minLength != null ? minLength.hashCode() : 0); result = 31 * result + (pattern != null ? pattern.hashCode() : 0); result = 31 * result + (maxItems != null ? maxItems.hashCode() : 0); result = 31 * result + (minItems != null ? minItems.hashCode() : 0); - result = 31 * result + (uniqueItems != null ? uniqueItems.hashCode() : 0); + result = 31 * result + (uniqueItems ? 13:31); result = 31 * result + (multipleOf != null ? multipleOf.hashCode() : 0); return result; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java index 4f1c9c54c3e..52fd5f4f76b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java @@ -7,24 +7,20 @@ import java.util.Map; public class CodegenResponse { public final List headers = new ArrayList(); public String code, message; - public Boolean hasMore; + public boolean hasMore; public List> examples; public String dataType, baseType, containerType; - public Boolean isDefault; - public Boolean simpleType; - public Boolean primitiveType; - public Boolean isMapContainer; - public Boolean isListContainer; - public Boolean isBinary = Boolean.FALSE; - public Boolean isFile = Boolean.FALSE; + public boolean isDefault; + public boolean simpleType; + public boolean primitiveType; + public boolean isMapContainer; + public boolean isListContainer; + public boolean isBinary = false; + public boolean isFile = false; public Object schema; public String jsonSchema; public Map vendorExtensions; - public boolean isWildcard() { - return "0".equals(code) || "default".equals(code); - } - @Override public String toString() { return String.format("%s(%s)", code, containerType); @@ -43,7 +39,7 @@ public class CodegenResponse { return false; if (message != null ? !message.equals(that.message) : that.message != null) return false; - if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null) + if (hasMore != that.hasMore) return false; if (examples != null ? !examples.equals(that.examples) : that.examples != null) return false; @@ -53,19 +49,19 @@ public class CodegenResponse { return false; if (containerType != null ? !containerType.equals(that.containerType) : that.containerType != null) return false; - if (isDefault != null ? !isDefault.equals(that.isDefault) : that.isDefault != null) + if (isDefault != that.isDefault) return false; - if (simpleType != null ? !simpleType.equals(that.simpleType) : that.simpleType != null) + if (simpleType != that.simpleType) return false; - if (primitiveType != null ? !primitiveType.equals(that.primitiveType) : that.primitiveType != null) + if (primitiveType != that.primitiveType) return false; - if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null) + if (isMapContainer != that.isMapContainer) return false; - if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null) + if (isListContainer != that.isListContainer) return false; - if (isBinary != null ? !isBinary.equals(that.isBinary) : that.isBinary != null) + if (isBinary != that.isBinary) return false; - if (isFile != null ? !isFile.equals(that.isFile) : that.isFile != null) + if (isFile != that.isFile) return false; if (schema != null ? !schema.equals(that.schema) : that.schema != null) return false; @@ -80,18 +76,18 @@ public class CodegenResponse { int result = headers.hashCode(); result = 31 * result + (code != null ? code.hashCode() : 0); result = 31 * result + (message != null ? message.hashCode() : 0); - result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0); + result = 31 * result + (hasMore ? 13:31); result = 31 * result + (examples != null ? examples.hashCode() : 0); result = 31 * result + (dataType != null ? dataType.hashCode() : 0); result = 31 * result + (baseType != null ? baseType.hashCode() : 0); result = 31 * result + (containerType != null ? containerType.hashCode() : 0); - result = 31 * result + (isDefault != null ? isDefault.hashCode() : 0); - result = 31 * result + (simpleType != null ? simpleType.hashCode() : 0); - result = 31 * result + (primitiveType != null ? primitiveType.hashCode() : 0); - result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0); - result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0); - result = 31 * result + (isBinary != null ? isBinary.hashCode() : 0); - result = 31 * result + (isFile != null ? isFile.hashCode() : 0); + result = 31 * result + (isDefault ? 13:31); + result = 31 * result + (simpleType ? 13:31); + result = 31 * result + (primitiveType ? 13:31); + result = 31 * result + (isMapContainer ? 13:31); + result = 31 * result + (isListContainer ? 13:31); + result = 31 * result + (isBinary ? 13:31); + result = 31 * result + (isFile ? 13:31); result = 31 * result + (schema != null ? schema.hashCode() : 0); result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0); result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 99b9ba4f381..9ac1cbba689 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2161,7 +2161,7 @@ public class DefaultCodegen { } else if (param instanceof FormParameter) { formParams.add(p.copy()); } - if (p.required == null || !p.required) { + if (!p.required) { op.hasOptionalParams = true; } } @@ -2179,10 +2179,8 @@ public class DefaultCodegen { Collections.sort(allParams, new Comparator() { @Override public int compare(CodegenParameter one, CodegenParameter another) { - boolean oneRequired = one.required == null ? false : one.required; - boolean anotherRequired = another.required == null ? false : another.required; - if (oneRequired == anotherRequired) return 0; - else if (oneRequired) return -1; + if (one.required == another.required) return 0; + else if (one.required) return -1; else return 1; } }); @@ -2410,14 +2408,14 @@ public class DefaultCodegen { p.minimum = qp.getMinimum() == null ? null : String.valueOf(qp.getMinimum()); } - p.exclusiveMaximum = qp.isExclusiveMaximum(); - p.exclusiveMinimum = qp.isExclusiveMinimum(); + p.exclusiveMaximum = qp.isExclusiveMaximum() == null ? false : qp.isExclusiveMaximum(); + p.exclusiveMinimum = qp.isExclusiveMinimum() == null ? false : qp.isExclusiveMinimum(); p.maxLength = qp.getMaxLength(); p.minLength = qp.getMinLength(); p.pattern = toRegularExpression(qp.getPattern()); p.maxItems = qp.getMaxItems(); p.minItems = qp.getMinItems(); - p.uniqueItems = qp.isUniqueItems(); + p.uniqueItems = qp.isUniqueItems() == null ? false : qp.isUniqueItems(); p.multipleOf = qp.getMultipleOf(); // exclusive* are noop without corresponding min/max diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java index 97f73fcebb6..96a8a7bb926 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java @@ -389,7 +389,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf // Query parameters appended to routes for (CodegenParameter param : op.queryParams) { String paramType = param.dataType; - if(param.isListContainer != null && param.isListContainer) { + if (param.isListContainer) { paramType = makeQueryListType(paramType, param.collectionFormat); } path.add("QueryParam \"" + param.baseName + "\" " + paramType); @@ -420,7 +420,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf path.add("Header \"" + param.baseName + "\" " + param.dataType); String paramType = param.dataType; - if(param.isListContainer != null && param.isListContainer) { + if (param.isListContainer) { paramType = makeQueryListType(paramType, param.collectionFormat); } type.add("Maybe " + paramType); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 8b68dcdbd16..dd211512906 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -710,7 +710,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; @@ -866,7 +866,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo List argList = new ArrayList(); boolean hasOptionalParams = false; for (CodegenParameter p : operation.allParams) { - if (p.required != null && p.required) { + if (p.required) { argList.add(p.paramName); } else { hasOptionalParams = true; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 4dca4806180..cab74966da1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -272,7 +272,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java index 06c23075e8e..3fbfd90e5e0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java @@ -158,7 +158,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index a661ba4ea42..b5079ead853 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -58,9 +58,9 @@ public class CodegenTest { final CodegenParameter file = op.formParams.get(1); Assert.assertTrue(file.isFormParam); Assert.assertEquals(file.dataType, "File"); - Assert.assertNull(file.required); + Assert.assertFalse(file.required); Assert.assertTrue(file.isFile); - Assert.assertNull(file.hasMore); + Assert.assertFalse(file.hasMore); } @Test(description = "read formParam values from a 2.0 spec") @@ -87,7 +87,7 @@ public class CodegenTest { Assert.assertTrue(idParam.isPathParam); Assert.assertEquals(idParam.dataType, "String"); Assert.assertTrue(idParam.required); - Assert.assertNull(idParam.hasMore); + Assert.assertFalse(idParam.hasMore); Assert.assertEquals(op.allParams.size(), 3); Assert.assertEquals(op.formParams.size(), 2); @@ -96,15 +96,15 @@ public class CodegenTest { Assert.assertTrue(nameParam.isFormParam); Assert.assertTrue(nameParam.notFile); Assert.assertEquals(nameParam.dataType, "String"); - Assert.assertNull(nameParam.required); + Assert.assertFalse(nameParam.required); Assert.assertTrue(nameParam.hasMore); final CodegenParameter statusParam = op.formParams.get(1); Assert.assertTrue(statusParam.isFormParam); Assert.assertTrue(statusParam.notFile); Assert.assertEquals(statusParam.dataType, "String"); - Assert.assertNull(statusParam.required); - Assert.assertNull(statusParam.hasMore); + Assert.assertFalse(statusParam.required); + Assert.assertFalse(statusParam.hasMore); } @Test(description = "handle enum array in query parameter test") From 7df1f8e2006a824a30ad2f665cc076b3c1c653d0 Mon Sep 17 00:00:00 2001 From: Igor Khomenko Date: Mon, 13 Feb 2017 14:59:36 +0200 Subject: [PATCH 007/132] Update DefaultGenerator.java (#4760) --- .../src/main/java/io/swagger/codegen/DefaultGenerator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 03433e64580..f6983d0340f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -154,8 +154,10 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { // set a default description if none if provided config.additionalProperties().put("appDescription", "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)"); + config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)"); } else { config.additionalProperties().put("appDescription", config.escapeText(info.getDescription())); + config.additionalProperties().put("unescapedAppDescription", info.getDescription()); } if (info.getContact() != null) { From 56251bf21409e388fcba3584f51b5a243aa88dad Mon Sep 17 00:00:00 2001 From: Igor Khomenko Date: Mon, 13 Feb 2017 15:47:51 +0200 Subject: [PATCH 008/132] added QuickBlox to 'Companies/Projects using Swagger Codegen' section (#4786) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 40767c2b202..b5c3886edf5 100644 --- a/README.md +++ b/README.md @@ -888,6 +888,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) +- [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) From ee23f8e50c9ac6e184b1e94a6eaba78be38a909b Mon Sep 17 00:00:00 2001 From: clasnake Date: Mon, 13 Feb 2017 22:33:55 +0800 Subject: [PATCH 009/132] Fix finch package name. (#4755) --- .../codegen/languages/FinchServerCodegen.java | 6 +- samples/server/petstore/finch/LICENSE | 201 ----------------- .../finch/src/main/scala/DataAccessor.scala | 208 +++++++++--------- .../finch/src/main/scala/Server.scala | 11 +- .../finch/src/main/scala/endpoint.scala | 44 ++-- .../finch/src/main/scala/errors.scala | 2 +- .../main/scala/io/swagger/apis/PetApi.scala | 149 +++++++++++++ .../main/scala/io/swagger/apis/StoreApi.scala | 96 ++++++++ .../main/scala/io/swagger/apis/UserApi.scala | 150 +++++++++++++ .../scala/io/swagger/models/ApiResponse.scala | 26 +++ .../scala/io/swagger/models/Category.scala | 24 ++ .../main/scala/io/swagger/models/Order.scala | 33 +++ .../main/scala/io/swagger/models/Pet.scala | 35 +++ .../main/scala/io/swagger/models/Tag.scala | 24 ++ .../main/scala/io/swagger/models/User.scala | 36 +++ .../io/swagger/petstore/apis/PetApi.scala | 148 ------------- .../io/swagger/petstore/apis/StoreApi.scala | 95 -------- .../io/swagger/petstore/apis/UserApi.scala | 149 ------------- .../swagger/petstore/models/ApiResponse.scala | 27 --- .../io/swagger/petstore/models/Category.scala | 25 --- .../io/swagger/petstore/models/Order.scala | 34 --- .../io/swagger/petstore/models/Pet.scala | 36 --- .../io/swagger/petstore/models/Tag.scala | 25 --- .../io/swagger/petstore/models/User.scala | 37 ---- 24 files changed, 709 insertions(+), 912 deletions(-) delete mode 100644 samples/server/petstore/finch/LICENSE create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala create mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/ApiResponse.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Category.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Order.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Pet.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Tag.scala delete mode 100644 samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/User.scala diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java index 4a3eed3a01b..f807325c144 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java @@ -15,12 +15,12 @@ import java.util.List; import java.util.Map; public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig { - protected String invokerPackage = "io.swagger.petstore.client"; + protected String invokerPackage = "io.swagger.client"; protected String groupId = "io.swagger"; protected String artifactId = "finch-server"; protected String artifactVersion = "1.0.0"; protected String sourceFolder = "src/main/scala"; - protected String packageName = "io.swagger.petstore"; + protected String packageName = "io.swagger"; public FinchServerCodegen() { super(); @@ -156,7 +156,7 @@ public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig importMapping.put("LocalTime", "java.time.LocalTime"); cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Finch package name (e.g. io.swagger.petstore).") + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Finch package name (e.g. io.swagger).") .defaultValue(this.packageName)); cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); diff --git a/samples/server/petstore/finch/LICENSE b/samples/server/petstore/finch/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/samples/server/petstore/finch/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/samples/server/petstore/finch/src/main/scala/DataAccessor.scala b/samples/server/petstore/finch/src/main/scala/DataAccessor.scala index bcbd036637c..4c9d06b2ea9 100644 --- a/samples/server/petstore/finch/src/main/scala/DataAccessor.scala +++ b/samples/server/petstore/finch/src/main/scala/DataAccessor.scala @@ -1,133 +1,133 @@ -package io.swagger.petstore +package io.swagger // TODO: properly handle custom imports import java.io._ import java.util.Date -import io.swagger.petstore.models._ +import io.swagger.models._ trait DataAccessor { - // TODO: apiInfo -> apis -> operations = ??? - // NOTE: ??? throws a not implemented exception + // TODO: apiInfo -> apis -> operations = ??? + // NOTE: ??? throws a not implemented exception - /** - * - * @return A Unit - */ - def Pet_addPet(body: Pet): Unit = ??? + /** + * + * @return A Unit + */ + def Pet_addPet(body: Pet): Unit = ??? - /** - * - * @return A Unit - */ - def Pet_deletePet(petId: Long, apiKey: String): Unit = ??? + /** + * + * @return A Unit + */ + def Pet_deletePet(petId: Long, apiKey: String): Unit = ??? - /** - * - * @return A Seq[Pet] - */ - def Pet_findPetsByStatus(status: Seq[String]): Seq[Pet] = ??? + /** + * + * @return A Seq[Pet] + */ + def Pet_findPetsByStatus(status: Seq[String]): Seq[Pet] = ??? - /** - * - * @return A Seq[Pet] - */ - def Pet_findPetsByTags(tags: Seq[String]): Seq[Pet] = ??? + /** + * + * @return A Seq[Pet] + */ + def Pet_findPetsByTags(tags: Seq[String]): Seq[Pet] = ??? - /** - * - * @return A Pet - */ - def Pet_getPetById(petId: Long): Pet = ??? + /** + * + * @return A Pet + */ + def Pet_getPetById(petId: Long): Pet = ??? - /** - * - * @return A Unit - */ - def Pet_updatePet(body: Pet): Unit = ??? + /** + * + * @return A Unit + */ + def Pet_updatePet(body: Pet): Unit = ??? - /** - * - * @return A Unit - */ - def Pet_updatePetWithForm(petId: Long, name: String, status: String): Unit = ??? + /** + * + * @return A Unit + */ + def Pet_updatePetWithForm(petId: Long, name: String, status: String): Unit = ??? - /** - * - * @return A ApiResponse - */ - def Pet_uploadFile(petId: Long, additionalMetadata: String, file: File): ApiResponse = ??? + /** + * + * @return A ApiResponse + */ + def Pet_uploadFile(petId: Long, additionalMetadata: String, file: File): ApiResponse = ??? - /** - * - * @return A Unit - */ - def Store_deleteOrder(orderId: String): Unit = ??? + /** + * + * @return A Unit + */ + def Store_deleteOrder(orderId: String): Unit = ??? - /** - * - * @return A Map[String, Int] - */ - def Store_getInventory(): Map[String, Int] = ??? + /** + * + * @return A Map[String, Int] + */ + def Store_getInventory(): Map[String, Int] = ??? - /** - * - * @return A Order - */ - def Store_getOrderById(orderId: Long): Order = ??? + /** + * + * @return A Order + */ + def Store_getOrderById(orderId: Long): Order = ??? - /** - * - * @return A Order - */ - def Store_placeOrder(body: Order): Order = ??? + /** + * + * @return A Order + */ + def Store_placeOrder(body: Order): Order = ??? - /** - * - * @return A Unit - */ - def User_createUser(body: User): Unit = ??? + /** + * + * @return A Unit + */ + def User_createUser(body: User): Unit = ??? - /** - * - * @return A Unit - */ - def User_createUsersWithArrayInput(body: Seq[User]): Unit = ??? + /** + * + * @return A Unit + */ + def User_createUsersWithArrayInput(body: Seq[User]): Unit = ??? - /** - * - * @return A Unit - */ - def User_createUsersWithListInput(body: Seq[User]): Unit = ??? + /** + * + * @return A Unit + */ + def User_createUsersWithListInput(body: Seq[User]): Unit = ??? - /** - * - * @return A Unit - */ - def User_deleteUser(username: String): Unit = ??? + /** + * + * @return A Unit + */ + def User_deleteUser(username: String): Unit = ??? - /** - * - * @return A User - */ - def User_getUserByName(username: String): User = ??? + /** + * + * @return A User + */ + def User_getUserByName(username: String): User = ??? - /** - * - * @return A String - */ - def User_loginUser(username: String, password: String): String = ??? + /** + * + * @return A String + */ + def User_loginUser(username: String, password: String): String = ??? - /** - * - * @return A Unit - */ - def User_logoutUser(): Unit = ??? + /** + * + * @return A Unit + */ + def User_logoutUser(): Unit = ??? - /** - * - * @return A Unit - */ - def User_updateUser(username: String, body: User): Unit = ??? + /** + * + * @return A Unit + */ + def User_updateUser(username: String, body: User): Unit = ??? } \ No newline at end of file diff --git a/samples/server/petstore/finch/src/main/scala/Server.scala b/samples/server/petstore/finch/src/main/scala/Server.scala index 716b6eae52e..ec3ed482e27 100644 --- a/samples/server/petstore/finch/src/main/scala/Server.scala +++ b/samples/server/petstore/finch/src/main/scala/Server.scala @@ -1,22 +1,23 @@ -package io.swagger.petstore +package io.swagger import io.finch._ import io.finch.circe._ -import io.circe.{ Decoder, ObjectEncoder } +import io.circe.{Decoder, ObjectEncoder} import io.circe.generic.auto._ import io.circe.generic.semiauto import io.circe.generic.semiauto._ import io.circe.java8.time._ import com.twitter.finagle.Http import com.twitter.finagle.util.LoadService -import com.twitter.util.{ Await, Future } +import com.twitter.util.{Await, Future} + class Server { - // Loads implementation defined in resources/META-INF/services/io.swagger.petstore.DataAccessor + // Loads implementation defined in resources/META-INF/services/io.swagger.DataAccessor val db = LoadService[DataAccessor]() match { case accessor :: _ => accessor - case _ => new DataAccessor {} + case _ => new DataAccessor { } } val service = endpoint.makeService(db) diff --git a/samples/server/petstore/finch/src/main/scala/endpoint.scala b/samples/server/petstore/finch/src/main/scala/endpoint.scala index df0093b7b13..5241b51bbd8 100644 --- a/samples/server/petstore/finch/src/main/scala/endpoint.scala +++ b/samples/server/petstore/finch/src/main/scala/endpoint.scala @@ -1,15 +1,15 @@ -package io.swagger.petstore +package io.swagger import com.twitter.finagle.Service -import com.twitter.finagle.http.{ Request, Response } +import com.twitter.finagle.http.{Request, Response} import com.twitter.finagle.http.exp.Multipart.FileUpload import com.twitter.util.Future import io.finch._, items._ -import io.circe.{ Encoder, Json } +import io.circe.{Encoder, Json} import io.finch.circe._ import io.circe.generic.semiauto._ -import io.swagger.petstore.apis._ +import io.swagger.apis._ /** * Provides the paths and endpoints for all the API's public service methods. @@ -17,32 +17,32 @@ import io.swagger.petstore.apis._ object endpoint { def errorToJson(e: Exception): Json = e match { - case Error.NotPresent(_) => - Json.obj("error" -> Json.fromString("something_not_present")) - case Error.NotParsed(_, _, _) => - Json.obj("error" -> Json.fromString("something_not_parsed")) - case Error.NotValid(_, _) => - Json.obj("error" -> Json.fromString("something_not_valid")) - case error: PetstoreError => - Json.obj("error" -> Json.fromString(error.message)) + case Error.NotPresent(_) => + Json.obj("error" -> Json.fromString("something_not_present")) + case Error.NotParsed(_, _, _) => + Json.obj("error" -> Json.fromString("something_not_parsed")) + case Error.NotValid(_, _) => + Json.obj("error" -> Json.fromString("something_not_valid")) + case error: PetstoreError => + Json.obj("error" -> Json.fromString(error.message)) } implicit val ee: Encoder[Exception] = Encoder.instance { - case e: Error => errorToJson(e) - case Errors(nel) => Json.arr(nel.toList.map(errorToJson): _*) + case e: Error => errorToJson(e) + case Errors(nel) => Json.arr(nel.toList.map(errorToJson): _*) } /** - * Compiles together all the endpoints relating to public service methods. - * - * @return A service that contains all provided endpoints of the API. - */ + * Compiles together all the endpoints relating to public service methods. + * + * @return A service that contains all provided endpoints of the API. + */ def makeService(da: DataAccessor): Service[Request, Response] = ( - PetApi.endpoints(da) :+: - StoreApi.endpoints(da) :+: - UserApi.endpoints(da) + PetApi.endpoints(da) :+: + StoreApi.endpoints(da) :+: + UserApi.endpoints(da) ).handle({ case e: PetstoreError => NotFound(e) - }).toService + }).toService } \ No newline at end of file diff --git a/samples/server/petstore/finch/src/main/scala/errors.scala b/samples/server/petstore/finch/src/main/scala/errors.scala index 69e3831c15d..162549e0f23 100644 --- a/samples/server/petstore/finch/src/main/scala/errors.scala +++ b/samples/server/petstore/finch/src/main/scala/errors.scala @@ -1,4 +1,4 @@ -package io.swagger.petstore +package io.swagger /** * The parent error from which most PetstoreAPI errors extend. Thrown whenever something in the api goes wrong. diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala new file mode 100644 index 00000000000..74a01c56f51 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala @@ -0,0 +1,149 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import io.swagger.models.ApiResponse +import java.io.File +import io.swagger.models.Pet +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object PetApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + addPet(da) :+: + deletePet(da) :+: + findPetsByStatus(da) :+: + findPetsByTags(da) :+: + getPetById(da) :+: + updatePet(da) :+: + updatePetWithForm(da) :+: + uploadFile(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def addPet(da: DataAccessor): Endpoint[Unit] = + post("pet" :: jsonBody[Pet]) { (body: Pet) => + da.Pet_addPet(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def deletePet(da: DataAccessor): Endpoint[Unit] = + delete("pet" :: long :: string) { (petId: Long, apiKey: String) => + da.Pet_deletePet(petId, apiKey) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Seq[Pet] + */ + private def findPetsByStatus(da: DataAccessor): Endpoint[Seq[Pet]] = + get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => + Ok(da.Pet_findPetsByStatus(status)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Seq[Pet] + */ + private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = + get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => + Ok(da.Pet_findPetsByTags(tags)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Pet + */ + private def getPetById(da: DataAccessor): Endpoint[Pet] = + get("pet" :: long ) { (petId: Long) => + Ok(da.Pet_getPetById(petId)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updatePet(da: DataAccessor): Endpoint[Unit] = + put("pet" :: jsonBody[Pet]) { (body: Pet) => + da.Pet_updatePet(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updatePetWithForm(da: DataAccessor): Endpoint[Unit] = + post("pet" :: long :: string :: string) { (petId: Long, name: String, status: String) => + da.Pet_updatePetWithForm(petId, name, status) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a ApiResponse + */ + private def uploadFile(da: DataAccessor): Endpoint[ApiResponse] = + post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: String, file: FileUpload) => + Ok(da.Pet_uploadFile(petId, additionalMetadata, file)) + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpPetApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala new file mode 100644 index 00000000000..02186ce1f65 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala @@ -0,0 +1,96 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import io.swagger.models.Order +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object StoreApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + deleteOrder(da) :+: + getInventory(da) :+: + getOrderById(da) :+: + placeOrder(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def deleteOrder(da: DataAccessor): Endpoint[Unit] = + delete("store" :: "order" :: string ) { (orderId: String) => + da.Store_deleteOrder(orderId) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Map[String, Int] + */ + private def getInventory(da: DataAccessor): Endpoint[Map[String, Int]] = + get("store" :: "inventory" ) { + Ok(da.Store_getInventory()) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Order + */ + private def getOrderById(da: DataAccessor): Endpoint[Order] = + get("store" :: "order" :: long ) { (orderId: Long) => + Ok(da.Store_getOrderById(orderId)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Order + */ + private def placeOrder(da: DataAccessor): Endpoint[Order] = + post("store" :: "order" :: jsonBody[Order]) { (body: Order) => + Ok(da.Store_placeOrder(body)) + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpStoreApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala new file mode 100644 index 00000000000..dfb49b4291a --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala @@ -0,0 +1,150 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import scala.collection.immutable.Seq +import io.swagger.models.User +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object UserApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + createUser(da) :+: + createUsersWithArrayInput(da) :+: + createUsersWithListInput(da) :+: + deleteUser(da) :+: + getUserByName(da) :+: + loginUser(da) :+: + logoutUser(da) :+: + updateUser(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def createUser(da: DataAccessor): Endpoint[Unit] = + post("user" :: jsonBody[User]) { (body: User) => + da.User_createUser(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = + post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + da.User_createUsersWithArrayInput(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = + post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + da.User_createUsersWithListInput(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def deleteUser(da: DataAccessor): Endpoint[Unit] = + delete("user" :: string ) { (username: String) => + da.User_deleteUser(username) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a User + */ + private def getUserByName(da: DataAccessor): Endpoint[User] = + get("user" :: string ) { (username: String) => + Ok(da.User_getUserByName(username)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a String + */ + private def loginUser(da: DataAccessor): Endpoint[String] = + get("user" :: "login" :: string :: string) { (username: String, password: String) => + Ok(da.User_loginUser(username, password)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def logoutUser(da: DataAccessor): Endpoint[Unit] = + get("user" :: "logout" ) { + da.User_logoutUser() + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updateUser(da: DataAccessor): Endpoint[Unit] = + put("user" :: string :: jsonBody[User]) { (username: String, body: User) => + da.User_updateUser(username, body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpUserApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala new file mode 100644 index 00000000000..9e603aadec6 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala @@ -0,0 +1,26 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * Describes the result of uploading an image resource + * @param code + * @param _type + * @param message + */ +case class ApiResponse(code: Option[Int], + _type: Option[String], + message: Option[String] + ) + +object ApiResponse { + /** + * Creates the codec for converting ApiResponse from and to JSON. + */ + implicit val decoder: Decoder[ApiResponse] = deriveDecoder + implicit val encoder: ObjectEncoder[ApiResponse] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala new file mode 100644 index 00000000000..be697aa298e --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala @@ -0,0 +1,24 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A category for a pet + * @param id + * @param name + */ +case class Category(id: Option[Long], + name: Option[String] + ) + +object Category { + /** + * Creates the codec for converting Category from and to JSON. + */ + implicit val decoder: Decoder[Category] = deriveDecoder + implicit val encoder: ObjectEncoder[Category] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala new file mode 100644 index 00000000000..2934ee921b3 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala @@ -0,0 +1,33 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ +import java.time.LocalDateTime + +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +case class Order(id: Option[Long], + petId: Option[Long], + quantity: Option[Int], + shipDate: Option[LocalDateTime], + status: Option[String], + complete: Option[Boolean] + ) + +object Order { + /** + * Creates the codec for converting Order from and to JSON. + */ + implicit val decoder: Decoder[Order] = deriveDecoder + implicit val encoder: ObjectEncoder[Order] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala new file mode 100644 index 00000000000..e78617c7db8 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala @@ -0,0 +1,35 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ +import io.swagger.models.Category +import io.swagger.models.Tag +import scala.collection.immutable.Seq + +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +case class Pet(id: Option[Long], + category: Option[Category], + name: String, + photoUrls: Seq[String], + tags: Option[Seq[Tag]], + status: Option[String] + ) + +object Pet { + /** + * Creates the codec for converting Pet from and to JSON. + */ + implicit val decoder: Decoder[Pet] = deriveDecoder + implicit val encoder: ObjectEncoder[Pet] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala new file mode 100644 index 00000000000..242ffcfc86e --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala @@ -0,0 +1,24 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A tag for a pet + * @param id + * @param name + */ +case class Tag(id: Option[Long], + name: Option[String] + ) + +object Tag { + /** + * Creates the codec for converting Tag from and to JSON. + */ + implicit val decoder: Decoder[Tag] = deriveDecoder + implicit val encoder: ObjectEncoder[Tag] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala new file mode 100644 index 00000000000..18253b5deae --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala @@ -0,0 +1,36 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +case class User(id: Option[Long], + username: Option[String], + firstName: Option[String], + lastName: Option[String], + email: Option[String], + password: Option[String], + phone: Option[String], + userStatus: Option[Int] + ) + +object User { + /** + * Creates the codec for converting User from and to JSON. + */ + implicit val decoder: Decoder[User] = deriveDecoder + implicit val encoder: ObjectEncoder[User] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala deleted file mode 100644 index 420279685d3..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala +++ /dev/null @@ -1,148 +0,0 @@ -package io.swagger.petstore.apis - -import java.io._ -import java.util.Date -import io.swagger.petstore._ -import io.swagger.petstore.models._ -import io.swagger.petstore.models.Pet -import java.io.File -import io.swagger.petstore.models.ApiResponse -import io.finch.circe._ -import io.circe.generic.semiauto._ -import com.twitter.concurrent.AsyncStream -import com.twitter.finagle.Service -import com.twitter.finagle.Http -import com.twitter.finagle.http.{ Request, Response } -import com.twitter.finagle.http.exp.Multipart.{ FileUpload, InMemoryFileUpload, OnDiskFileUpload } -import com.twitter.util.Future -import com.twitter.io.Buf -import io.finch._, items._ -import java.io.File - -object PetApi { - /** - * Compiles all service endpoints. - * @return Bundled compilation of all service endpoints. - */ - def endpoints(da: DataAccessor) = - addPet(da) :+: - deletePet(da) :+: - findPetsByStatus(da) :+: - findPetsByTags(da) :+: - getPetById(da) :+: - updatePet(da) :+: - updatePetWithForm(da) :+: - uploadFile(da) - - /** - * - * @return And endpoint representing a Unit - */ - private def addPet(da: DataAccessor): Endpoint[Unit] = - post("pet" :: jsonBody[Pet]) { (body: Pet) => - da.Pet_addPet(body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def deletePet(da: DataAccessor): Endpoint[Unit] = - delete("pet" :: long :: string) { (petId: Long, apiKey: String) => - da.Pet_deletePet(petId, apiKey) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Seq[Pet] - */ - private def findPetsByStatus(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => - Ok(da.Pet_findPetsByStatus(status)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Seq[Pet] - */ - private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => - Ok(da.Pet_findPetsByTags(tags)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Pet - */ - private def getPetById(da: DataAccessor): Endpoint[Pet] = - get("pet" :: long) { (petId: Long) => - Ok(da.Pet_getPetById(petId)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def updatePet(da: DataAccessor): Endpoint[Unit] = - put("pet" :: jsonBody[Pet]) { (body: Pet) => - da.Pet_updatePet(body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def updatePetWithForm(da: DataAccessor): Endpoint[Unit] = - post("pet" :: long :: string :: string) { (petId: Long, name: String, status: String) => - da.Pet_updatePetWithForm(petId, name, status) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a ApiResponse - */ - private def uploadFile(da: DataAccessor): Endpoint[ApiResponse] = - post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: String, file: FileUpload) => - Ok(da.Pet_uploadFile(petId, additionalMetadata, file)) - } handle { - case e: Exception => BadRequest(e) - } - - implicit private def fileUploadToFile(fileUpload: FileUpload): File = { - fileUpload match { - case upload: InMemoryFileUpload => - bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) - case upload: OnDiskFileUpload => - upload.content - case _ => null - } - } - - private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpPetApi", null) - val output = new FileOutputStream(file) - output.write(input) - file - } - - // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. - implicit def seqList[A](input: Seq[A]): List[A] = input.toList -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala deleted file mode 100644 index 38dda7b4786..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala +++ /dev/null @@ -1,95 +0,0 @@ -package io.swagger.petstore.apis - -import java.io._ -import java.util.Date -import io.swagger.petstore._ -import io.swagger.petstore.models._ -import io.swagger.petstore.models.Order -import io.finch.circe._ -import io.circe.generic.semiauto._ -import com.twitter.concurrent.AsyncStream -import com.twitter.finagle.Service -import com.twitter.finagle.Http -import com.twitter.finagle.http.{ Request, Response } -import com.twitter.finagle.http.exp.Multipart.{ FileUpload, InMemoryFileUpload, OnDiskFileUpload } -import com.twitter.util.Future -import com.twitter.io.Buf -import io.finch._, items._ -import java.io.File - -object StoreApi { - /** - * Compiles all service endpoints. - * @return Bundled compilation of all service endpoints. - */ - def endpoints(da: DataAccessor) = - deleteOrder(da) :+: - getInventory(da) :+: - getOrderById(da) :+: - placeOrder(da) - - /** - * - * @return And endpoint representing a Unit - */ - private def deleteOrder(da: DataAccessor): Endpoint[Unit] = - delete("store" :: "order" :: string) { (orderId: String) => - da.Store_deleteOrder(orderId) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Map[String, Int] - */ - private def getInventory(da: DataAccessor): Endpoint[Map[String, Int]] = - get("store" :: "inventory") { - Ok(da.Store_getInventory()) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Order - */ - private def getOrderById(da: DataAccessor): Endpoint[Order] = - get("store" :: "order" :: long) { (orderId: Long) => - Ok(da.Store_getOrderById(orderId)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Order - */ - private def placeOrder(da: DataAccessor): Endpoint[Order] = - post("store" :: "order" :: jsonBody[Order]) { (body: Order) => - Ok(da.Store_placeOrder(body)) - } handle { - case e: Exception => BadRequest(e) - } - - implicit private def fileUploadToFile(fileUpload: FileUpload): File = { - fileUpload match { - case upload: InMemoryFileUpload => - bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) - case upload: OnDiskFileUpload => - upload.content - case _ => null - } - } - - private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpStoreApi", null) - val output = new FileOutputStream(file) - output.write(input) - file - } - - // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. - implicit def seqList[A](input: Seq[A]): List[A] = input.toList -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala deleted file mode 100644 index 560509a349c..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala +++ /dev/null @@ -1,149 +0,0 @@ -package io.swagger.petstore.apis - -import java.io._ -import java.util.Date -import io.swagger.petstore._ -import io.swagger.petstore.models._ -import io.swagger.petstore.models.User -import scala.collection.immutable.Seq -import io.finch.circe._ -import io.circe.generic.semiauto._ -import com.twitter.concurrent.AsyncStream -import com.twitter.finagle.Service -import com.twitter.finagle.Http -import com.twitter.finagle.http.{ Request, Response } -import com.twitter.finagle.http.exp.Multipart.{ FileUpload, InMemoryFileUpload, OnDiskFileUpload } -import com.twitter.util.Future -import com.twitter.io.Buf -import io.finch._, items._ -import java.io.File - -object UserApi { - /** - * Compiles all service endpoints. - * @return Bundled compilation of all service endpoints. - */ - def endpoints(da: DataAccessor) = - createUser(da) :+: - createUsersWithArrayInput(da) :+: - createUsersWithListInput(da) :+: - deleteUser(da) :+: - getUserByName(da) :+: - loginUser(da) :+: - logoutUser(da) :+: - updateUser(da) - - /** - * - * @return And endpoint representing a Unit - */ - private def createUser(da: DataAccessor): Endpoint[Unit] = - post("user" :: jsonBody[User]) { (body: User) => - da.User_createUser(body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => - da.User_createUsersWithArrayInput(body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => - da.User_createUsersWithListInput(body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def deleteUser(da: DataAccessor): Endpoint[Unit] = - delete("user" :: string) { (username: String) => - da.User_deleteUser(username) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a User - */ - private def getUserByName(da: DataAccessor): Endpoint[User] = - get("user" :: string) { (username: String) => - Ok(da.User_getUserByName(username)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a String - */ - private def loginUser(da: DataAccessor): Endpoint[String] = - get("user" :: "login" :: string :: string) { (username: String, password: String) => - Ok(da.User_loginUser(username, password)) - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def logoutUser(da: DataAccessor): Endpoint[Unit] = - get("user" :: "logout") { - da.User_logoutUser() - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - /** - * - * @return And endpoint representing a Unit - */ - private def updateUser(da: DataAccessor): Endpoint[Unit] = - put("user" :: string :: jsonBody[User]) { (username: String, body: User) => - da.User_updateUser(username, body) - NoContent[Unit] - } handle { - case e: Exception => BadRequest(e) - } - - implicit private def fileUploadToFile(fileUpload: FileUpload): File = { - fileUpload match { - case upload: InMemoryFileUpload => - bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) - case upload: OnDiskFileUpload => - upload.content - case _ => null - } - } - - private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpUserApi", null) - val output = new FileOutputStream(file) - output.write(input) - file - } - - // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. - implicit def seqList[A](input: Seq[A]): List[A] = input.toList -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/ApiResponse.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/ApiResponse.scala deleted file mode 100644 index 248833a4e75..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/ApiResponse.scala +++ /dev/null @@ -1,27 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ - -/** - * Describes the result of uploading an image resource - * @param code - * @param _type - * @param message - */ -case class ApiResponse( - code: Option[Int], - _type: Option[String], - message: Option[String] -) - -object ApiResponse { - /** - * Creates the codec for converting ApiResponse from and to JSON. - */ - implicit val decoder: Decoder[ApiResponse] = deriveDecoder - implicit val encoder: ObjectEncoder[ApiResponse] = deriveEncoder -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Category.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Category.scala deleted file mode 100644 index ceb17f6b7e7..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Category.scala +++ /dev/null @@ -1,25 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ - -/** - * A category for a pet - * @param id - * @param name - */ -case class Category( - id: Option[Long], - name: Option[String] -) - -object Category { - /** - * Creates the codec for converting Category from and to JSON. - */ - implicit val decoder: Decoder[Category] = deriveDecoder - implicit val encoder: ObjectEncoder[Category] = deriveEncoder -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Order.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Order.scala deleted file mode 100644 index 08743ebbf13..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Order.scala +++ /dev/null @@ -1,34 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ -import java.time.LocalDateTime - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ -case class Order( - id: Option[Long], - petId: Option[Long], - quantity: Option[Int], - shipDate: Option[LocalDateTime], - status: Option[String], - complete: Option[Boolean] -) - -object Order { - /** - * Creates the codec for converting Order from and to JSON. - */ - implicit val decoder: Decoder[Order] = deriveDecoder - implicit val encoder: ObjectEncoder[Order] = deriveEncoder -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Pet.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Pet.scala deleted file mode 100644 index 4a17021b726..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Pet.scala +++ /dev/null @@ -1,36 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ -import io.swagger.petstore.models.Category -import io.swagger.petstore.models.Tag -import scala.collection.immutable.Seq - -/** - * A pet for sale in the pet store - * @param id - * @param category - * @param name - * @param photoUrls - * @param tags - * @param status pet status in the store - */ -case class Pet( - id: Option[Long], - category: Option[Category], - name: String, - photoUrls: Seq[String], - tags: Option[Seq[Tag]], - status: Option[String] -) - -object Pet { - /** - * Creates the codec for converting Pet from and to JSON. - */ - implicit val decoder: Decoder[Pet] = deriveDecoder - implicit val encoder: ObjectEncoder[Pet] = deriveEncoder -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Tag.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Tag.scala deleted file mode 100644 index 5fb213c0c3f..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/Tag.scala +++ /dev/null @@ -1,25 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ - -/** - * A tag for a pet - * @param id - * @param name - */ -case class Tag( - id: Option[Long], - name: Option[String] -) - -object Tag { - /** - * Creates the codec for converting Tag from and to JSON. - */ - implicit val decoder: Decoder[Tag] = deriveDecoder - implicit val encoder: ObjectEncoder[Tag] = deriveEncoder -} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/User.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/User.scala deleted file mode 100644 index 6556cdb437a..00000000000 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/models/User.scala +++ /dev/null @@ -1,37 +0,0 @@ -package io.swagger.petstore.models - -import io.circe._ -import io.finch.circe._ -import io.circe.generic.semiauto._ -import io.circe.java8.time._ -import io.swagger.petstore._ - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ -case class User( - id: Option[Long], - username: Option[String], - firstName: Option[String], - lastName: Option[String], - email: Option[String], - password: Option[String], - phone: Option[String], - userStatus: Option[Int] -) - -object User { - /** - * Creates the codec for converting User from and to JSON. - */ - implicit val decoder: Decoder[User] = deriveDecoder - implicit val encoder: ObjectEncoder[User] = deriveEncoder -} From 24474126e1f6c05009b60897b422c9061bfee767 Mon Sep 17 00:00:00 2001 From: Adnan Baruni Date: Tue, 14 Feb 2017 00:20:13 -0600 Subject: [PATCH 010/132] Issue 4742 (#4763) * add boolean datatype flags to CodegenResponse and logic to set them in DefaultCodegen * use Boolean.TRUE.equals to check for isResponseBinary or isResponseFile --- .../io/swagger/codegen/CodegenResponse.java | 1 + .../io/swagger/codegen/DefaultCodegen.java | 33 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java index 52fd5f4f76b..ec0f7f11bb5 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java @@ -10,6 +10,7 @@ public class CodegenResponse { public boolean hasMore; public List> examples; public String dataType, baseType, containerType; + public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBoolean, isDate, isDateTime; public boolean isDefault; public boolean simpleType; public boolean primitiveType; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 9ac1cbba689..d264523e08c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2046,10 +2046,10 @@ public class DefaultCodegen { } r.isDefault = response == methodResponse; op.responses.add(r); - if (r.isBinary && r.isDefault){ + if (Boolean.TRUE.equals(r.isBinary) && Boolean.TRUE.equals(r.isDefault)){ op.isResponseBinary = Boolean.TRUE; } - if (r.isFile && r.isDefault){ + if (Boolean.TRUE.equals(r.isFile) && Boolean.TRUE.equals(r.isDefault)){ op.isResponseFile = Boolean.TRUE; } } @@ -2249,8 +2249,33 @@ public class DefaultCodegen { } } r.dataType = cm.datatype; - r.isBinary = isDataTypeBinary(cm.datatype); - r.isFile = isDataTypeFile(cm.datatype); + + if (Boolean.TRUE.equals(cm.isString)) { + r.isString = true; + } else if (Boolean.TRUE.equals(cm.isBoolean)) { + r.isBoolean = true; + } else if (Boolean.TRUE.equals(cm.isLong)) { + r.isLong = true; + } else if (Boolean.TRUE.equals(cm.isInteger)) { + r.isInteger = true; + } else if (Boolean.TRUE.equals(cm.isDouble)) { + r.isDouble = true; + } else if (Boolean.TRUE.equals(cm.isFloat)) { + r.isFloat = true; + } else if (Boolean.TRUE.equals(cm.isByteArray)) { + r.isByteArray = true; + } else if (Boolean.TRUE.equals(cm.isBinary)) { + r.isBinary = true; + } else if (Boolean.TRUE.equals(cm.isFile)) { + r.isFile = true; + } else if (Boolean.TRUE.equals(cm.isDate)) { + r.isDate = true; + } else if (Boolean.TRUE.equals(cm.isDateTime)) { + r.isDateTime = true; + } else { + LOGGER.debug("Property type is not primitive: " + cm.datatype); + } + if (cm.isContainer) { r.simpleType = false; r.containerType = cm.containerType; From 26b1aa2b60105fdced5d6782743019125a3ea014 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 15 Feb 2017 16:24:57 +0800 Subject: [PATCH 011/132] update ts fetch petstore samples --- .../typescript-fetch/builds/default/api.ts | 80 +++++++++---------- .../typescript-fetch/builds/es6-target/api.ts | 80 +++++++++---------- .../builds/with-npm-version/api.ts | 80 +++++++++---------- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 1e821763c07..1ab5a830727 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -102,7 +102,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -131,7 +131,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -153,7 +153,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -175,7 +175,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -199,7 +199,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -218,7 +218,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -248,7 +248,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -279,7 +279,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * 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 */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -614,7 +614,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -632,7 +632,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -656,7 +656,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -675,7 +675,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -699,7 +699,7 @@ export const StoreApiFp = { * 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 */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -715,7 +715,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * 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 */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -854,7 +854,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -877,7 +877,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -900,7 +900,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -928,7 +928,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -952,7 +952,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -976,7 +976,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -994,7 +994,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1019,7 +1019,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1145,7 +1145,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index c5809c95808..5b787dc84bb 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -101,7 +101,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -130,7 +130,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = Object.assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -152,7 +152,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -174,7 +174,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -198,7 +198,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -217,7 +217,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -247,7 +247,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -278,7 +278,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -303,7 +303,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -321,7 +321,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -338,7 +338,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -355,7 +355,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -372,7 +372,7 @@ export const PetApiFp = { * 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 */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -389,7 +389,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -408,7 +408,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -427,7 +427,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -613,7 +613,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -631,7 +631,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -655,7 +655,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -674,7 +674,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -698,7 +698,7 @@ export const StoreApiFp = { * 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 */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -714,7 +714,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -731,7 +731,7 @@ export const StoreApiFp = { * 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 */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -748,7 +748,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -853,7 +853,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -876,7 +876,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -899,7 +899,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -927,7 +927,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -951,7 +951,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -975,7 +975,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -993,7 +993,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1018,7 +1018,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1042,7 +1042,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1059,7 +1059,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1076,7 +1076,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1093,7 +1093,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1110,7 +1110,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1128,7 +1128,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1144,7 +1144,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1162,7 +1162,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 1e821763c07..1ab5a830727 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -102,7 +102,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -131,7 +131,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -153,7 +153,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -175,7 +175,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -199,7 +199,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -218,7 +218,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -248,7 +248,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -279,7 +279,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * 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 */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -614,7 +614,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -632,7 +632,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -656,7 +656,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -675,7 +675,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -699,7 +699,7 @@ export const StoreApiFp = { * 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 */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -715,7 +715,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * 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 */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -854,7 +854,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -877,7 +877,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -900,7 +900,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -928,7 +928,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -952,7 +952,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -976,7 +976,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -994,7 +994,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1019,7 +1019,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1145,7 +1145,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { From accd1763828f87ac48f8ef7e2a422813662ce5e2 Mon Sep 17 00:00:00 2001 From: Paul English Date: Thu, 16 Feb 2017 02:00:26 -0700 Subject: [PATCH 012/132] Ensure that `ApiInvoker.scala` can support `UUID` types (#4807) --- .../src/main/resources/scala/apiInvoker.mustache | 2 ++ .../scala/src/main/scala/io/swagger/client/ApiInvoker.scala | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index 29b3f5ba96f..e1e420d7c6d 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -13,6 +13,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart import java.io.File import java.net.URLEncoder +import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ @@ -55,6 +56,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString def escape(value: Float): String = value.toString + def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 3e8b4496287..0db8a5c88e6 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -24,6 +24,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart import java.io.File import java.net.URLEncoder +import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ @@ -66,6 +67,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString def escape(value: Float): String = value.toString + def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { From bb81fc130aedd64a4d35232d5173b12ce758e967 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 16 Feb 2017 17:39:06 +0800 Subject: [PATCH 013/132] remove unused files for nodejs gcf (#4808) --- .../index.mustache | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache diff --git a/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache b/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache deleted file mode 100644 index b406ff7f140..00000000000 --- a/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var swaggerTools = require('swagger-tools'); -var jsyaml = require('js-yaml'); -var fs = require('fs'); - -// swaggerRouter configuration -var options = { - controllers: './controllers', - useStubs: false -}; - -// The Swagger document (require it, build it programmatically, fetch it from a URL, ...) -var spec = fs.readFileSync('./api/swagger.yaml', 'utf8'); -var swaggerDoc = jsyaml.safeLoad(spec); - -function toPromise(f, req, res) { - return new Promise(function(resolve, reject) { - f(req, res, function(err) { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); -} - -exports.{{exportedName}} = function(req, res) { - swaggerTools.initializeMiddleware(swaggerDoc, function(middleware) { - var metadata = middleware.swaggerMetadata(); - var validator = middleware.swaggerValidator(); - var router = middleware.swaggerRouter(options); - req.url = swaggerDoc.basePath + req.url; - toPromise(metadata, req, res).then(function() { - return toPromise(validator, req, res); - }).then(function() { - return toPromise(router, req, res); - }).catch(function(err) { - console.error(err); - res.status(res.statusCode || 400).send(err); - }); - }); -}; From 23d114e1eb183617358da47813846222f5f1a8b1 Mon Sep 17 00:00:00 2001 From: Tristan Sokol Date: Sun, 19 Feb 2017 23:13:06 -0800 Subject: [PATCH 014/132] Fix minor spelling mistake in readme (#4818) --- .../swagger-codegen/src/main/resources/csharp/README.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/README.mustache b/modules/swagger-codegen/src/main/resources/csharp/README.mustache index 8c08c0e8667..066a7e93577 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/README.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/README.mustache @@ -31,7 +31,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json From 6746632834dad01834829a28b2a6e2ac535b8168 Mon Sep 17 00:00:00 2001 From: jsone-studios Date: Mon, 20 Feb 2017 09:18:09 +0100 Subject: [PATCH 015/132] Fix for #1940 - Show response headers (#4825) --- .../io/swagger/codegen/CodegenResponse.java | 1 + .../io/swagger/codegen/DefaultCodegen.java | 1 + .../main/resources/htmlDocs2/index.mustache | 63 ++- .../resources/2_0/responseHeaderTest.yaml | 41 ++ samples/html2/index.html | 405 +++++++++++++----- 5 files changed, 381 insertions(+), 130 deletions(-) create mode 100644 modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java index ec0f7f11bb5..b2a734fc9b2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java @@ -10,6 +10,7 @@ public class CodegenResponse { public boolean hasMore; public List> examples; public String dataType, baseType, containerType; + public boolean hasHeaders; public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBoolean, isDate, isDateTime; public boolean isDefault; public boolean simpleType; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index d264523e08c..586a95fefb4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2231,6 +2231,7 @@ public class DefaultCodegen { r.jsonSchema = Json.pretty(response); r.vendorExtensions = response.getVendorExtensions(); addHeaders(response, r.headers); + r.hasHeaders = !r.headers.isEmpty(); if (r.schema != null) { Property responseProperty = response.getSchema(); diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache index 01f9f2eb720..fc0f5f38204 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache @@ -336,24 +336,30 @@ {{#responses}}

Status: {{code}} - {{message}}

- {{#schema}} - -
-
-
- -
- +
{{#examples}} -
-
{{example}}
-
+
+
{{example}}
+
{{/examples}} -
- {{/schema}} + {{/schema}} + {{#hasHeaders}} +
+ + + + + + + + {{#headers}} + + + + + + + {{/headers}} +
NameTypeFormatDescription
{{#name}}{{name}}{{/name}}{{#datatype}}{{datatype}}{{/datatype}}{{#dataFormat}}{{dataFormat}}{{/dataFormat}}{{#description}}{{description}}{{/description}}
+
+ {{/hasHeaders}} + + {{/responses}} diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml new file mode 100644 index 00000000000..7c868bdabac --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml @@ -0,0 +1,41 @@ +swagger: '2.0' +info: + description: 'Test for displaying response headers' + version: 1.0.0 + title: Response header test + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +basePath: / +schemes: + - http +paths: + /test: + get: + summary: Test + description: Test + produces: + - application/json + responses: + '200': + description: successful operation + schema: + type: array + items: + type: string + headers: + X-STATUS: + type: "integer" + description: "Output status of the operation" + '500': + description: "Internal server error" + headers: + X-MSG-ID: + type: "string" + format: ".*" + description: "I am the error description" + X-ERROR-ID: + type: "integer" + description: "I am the error code" + '400': + description: Invalid ID supplied \ No newline at end of file diff --git a/samples/html2/index.html b/samples/html2/index.html index bec62b55586..92fccb3f651 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -1266,6 +1266,12 @@ except ApiException as e:

Responses

Status: 405 - Invalid input

+ + +
+
+
@@ -1555,7 +1561,7 @@ except ApiException as e: Name Description - apiKey + api_key @@ -1595,6 +1601,12 @@ except ApiException as e:

Responses

Status: 400 - Invalid pet value

+ + +
+
+
@@ -1858,8 +1870,8 @@ except ApiException as e: "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" }; @@ -1888,18 +1900,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid status value

+ + +
+
+
@@ -2224,18 +2242,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid tag value

+ + +
+
+
@@ -2571,18 +2595,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Pet not found

+ + +
+
+
@@ -2904,10 +2940,28 @@ except ApiException as e:

Responses

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Pet not found

+ + +
+
+

Status: 405 - Validation exception

+ + +
+
+
@@ -3280,6 +3334,12 @@ except ApiException as e:

Responses

Status: 405 - Invalid input

+ + +
+
+
@@ -3661,18 +3721,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +
@@ -3955,8 +4015,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Order not found

+ + +
+
+
@@ -4208,18 +4280,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +
@@ -4515,18 +4587,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Order not found

+ + +
+
+
@@ -4830,18 +4914,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid Order

+ + +
+
+
@@ -5137,6 +5227,12 @@ except ApiException as e:

Responses

Status: 0 - successful operation

+ + +
+
+
@@ -5402,6 +5498,12 @@ except ApiException as e:

Responses

Status: 0 - successful operation

+ + +
+
+
@@ -5667,6 +5769,12 @@ except ApiException as e:

Responses

Status: 0 - successful operation

+ + +
+
+
@@ -5918,8 +6026,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid username supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -6180,18 +6300,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid username supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -6527,18 +6659,20 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+
+ + + + + + + + + + + + + + + + + + + +
NameTypeFormatDescription
X-Rate-LimitIntegerint32calls per hour allowed by the user
X-Expires-AfterDatedate-timedate in UTC when toekn expires
+
+ +

Status: 400 - Invalid username/password supplied

+ + +
+
+
@@ -6782,6 +6945,12 @@ except ApiException as e:

Responses

Status: 0 - successful operation

+ + +
+
+
@@ -7094,8 +7263,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid user supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -7112,7 +7293,7 @@ except ApiException as e:
- Generated 2017-01-24T11:58:21.560-05:00 + Generated 2017-02-18T23:37:57.057+01:00
From d11d0f88bb032d4a3302f90ab3addeb1a6b0559b Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 20 Feb 2017 16:51:31 +0800 Subject: [PATCH 016/132] fix warning in swagger json/yaml generator (#4827) --- .../swagger/codegen/languages/SwaggerGenerator.java | 12 ++++++++++++ .../codegen/languages/SwaggerYamlGenerator.java | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java index 6282f72d8b7..23935e4c557 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java @@ -52,4 +52,16 @@ public class SwaggerGenerator extends DefaultCodegen implements CodegenConfig { LOGGER.error(e.getMessage(), e); } } + + @Override + public String escapeQuotationMark(String input) { + // just return the original string + return input; + } + + @Override + public String escapeUnsafeCharacters(String input) { + // just return the original string + return input; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java index 9faa3041968..ad89a02e269 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java @@ -61,4 +61,17 @@ public class SwaggerYamlGenerator extends DefaultCodegen implements CodegenConfi LOGGER.error(e.getMessage(), e); } } + + @Override + public String escapeQuotationMark(String input) { + // just return the original string + return input; + } + + @Override + public String escapeUnsafeCharacters(String input) { + // just return the original string + return input; + } + } From 471598359a86b85ea2a877a367085f1993c889f9 Mon Sep 17 00:00:00 2001 From: Antoine Kurukchi Date: Wed, 22 Feb 2017 09:53:43 +0000 Subject: [PATCH 017/132] Added include to qt5cpp to fix library compile While creating a static library from the generated files, compilation issues arose due to QDateTime only being forward declared. Adding the include resolves the issue. --- .../src/main/resources/qt5cpp/helpers-body.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache index fb7b29b0107..8e1e975811e 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache @@ -5,6 +5,7 @@ #include #include #include +#include namespace Swagger { From de727d7d604dc5386b15891a73ad3ad56947fc10 Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 28 Feb 2017 17:20:35 +0100 Subject: [PATCH 018/132] [JaxrsResteasy] Improvements for Resteasy for Jboss EAP 4512 (#4712) * add language for resteasy eap #4512 * first implementation of jaxrs-resteasy-eap #4512 * add support for joda and java8 datetime types #4512 * add new file JacksonConfig and new sample eap-joda #4512 * add dynamic swagger support to jaxrs-resteasy-eap #4512 * adapt readme for eap #4512 * add tests for jaxrs-resteasy-eap #4512 * cleanup tabs #4512 * cleanup tabs #4512 * cleanup tabs #4512 * cleanup tabs / regenerate without joda #4512 * regenerate with updated templates #4512 * fix test (wrong setter invoked) #4512 * fix test #4512 * fix no invocation #4512 * replace tabs with spaces #4512 --- .../languages/AbstractJavaCodegen.java | 1 + .../JavaResteasyEapServerCodegen.java | 231 ++++++++++++++++++ .../features/BeanValidationFeatures.java | 2 +- .../languages/features/CXFServerFeatures.java | 3 +- .../PerformBeanValidationFeatures.java | 2 +- .../languages/features/SpringFeatures.java | 2 +- .../languages/features/SwaggerFeatures.java | 2 +- .../resteasy/eap/JacksonConfig.mustache | 39 +++ .../JavaJaxRS/resteasy/eap/README.mustache | 19 ++ .../resteasy/eap/RestApplication.mustache | 55 +++++ .../JavaJaxRS/resteasy/eap/api.mustache | 50 ++++ .../resteasy/eap/apiServiceImpl.mustache | 28 +++ .../resteasy/eap/beanValidation.mustache | 53 ++++ .../eap/beanValidationPathParams.mustache | 1 + .../eap/beanValidationQueryParams.mustache | 1 + .../resteasy/eap/bodyParams.mustache | 1 + .../JavaJaxRS/resteasy/eap/enumClass.mustache | 24 ++ .../resteasy/eap/enumOuterClass.mustache | 3 + .../resteasy/eap/formParams.mustache | 1 + .../resteasy/eap/generatedAnnotation.mustache | 1 + .../JavaJaxRS/resteasy/eap/gradle.mustache | 32 +++ .../resteasy/eap/headerParams.mustache | 1 + .../JavaJaxRS/resteasy/eap/jboss-web.mustache | 3 + .../JavaJaxRS/resteasy/eap/model.mustache | 22 ++ .../resteasy/eap/pathParams.mustache | 1 + .../JavaJaxRS/resteasy/eap/pojo.mustache | 70 ++++++ .../JavaJaxRS/resteasy/eap/pom.mustache | 184 ++++++++++++++ .../resteasy/eap/queryParams.mustache | 1 + .../resteasy/eap/serviceBodyParams.mustache | 1 + .../resteasy/eap/serviceFormParams.mustache | 1 + .../resteasy/eap/serviceHeaderParams.mustache | 1 + .../resteasy/eap/servicePathParams.mustache | 1 + .../resteasy/eap/serviceQueryParams.mustache | 1 + .../resteasy/eap/settingsGradle.mustache | 1 + .../JavaJaxRS/resteasy/eap/web.mustache | 9 + .../services/io.swagger.codegen.CodegenConfig | 1 + .../JavaResteasyEapServerOptionsTest.java | 77 ++++++ .../JavaResteasyEapServerOptionsProvider.java | 50 ++++ .../eap-joda/.swagger-codegen-ignore | 23 ++ .../jaxrs-resteasy/eap-joda/README.md | 23 ++ .../jaxrs-resteasy/eap-joda/build.gradle | 30 +++ .../petstore/jaxrs-resteasy/eap-joda/pom.xml | 173 +++++++++++++ .../jaxrs-resteasy/eap-joda/settings.gradle | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 143 +++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 70 ++++++ .../src/gen/java/io/swagger/api/UserApi.java | 102 ++++++++ .../gen/java/io/swagger/model/Category.java | 83 +++++++ .../io/swagger/model/ModelApiResponse.java | 98 ++++++++ .../src/gen/java/io/swagger/model/Order.java | 169 +++++++++++++ .../src/gen/java/io/swagger/model/Pet.java | 173 +++++++++++++ .../src/gen/java/io/swagger/model/Tag.java | 83 +++++++ .../src/gen/java/io/swagger/model/User.java | 174 +++++++++++++ .../java/io/swagger/api/JacksonConfig.java | 34 +++ .../java/io/swagger/api/RestApplication.java | 31 +++ .../swagger/api/impl/PetApiServiceImpl.java | 53 ++++ .../swagger/api/impl/StoreApiServiceImpl.java | 35 +++ .../swagger/api/impl/UserApiServiceImpl.java | 51 ++++ .../src/main/webapp/WEB-INF/jboss-web.xml | 3 + .../eap-joda/src/main/webapp/WEB-INF/web.xml | 9 + .../eap/.swagger-codegen-ignore | 23 ++ .../petstore/jaxrs-resteasy/eap/README.md | 23 ++ .../petstore/jaxrs-resteasy/eap/build.gradle | 28 +++ .../petstore/jaxrs-resteasy/eap/pom.xml | 168 +++++++++++++ .../jaxrs-resteasy/eap/settings.gradle | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 143 +++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 70 ++++++ .../src/gen/java/io/swagger/api/UserApi.java | 102 ++++++++ .../gen/java/io/swagger/model/Category.java | 83 +++++++ .../io/swagger/model/ModelApiResponse.java | 98 ++++++++ .../src/gen/java/io/swagger/model/Order.java | 169 +++++++++++++ .../src/gen/java/io/swagger/model/Pet.java | 173 +++++++++++++ .../src/gen/java/io/swagger/model/Tag.java | 83 +++++++ .../src/gen/java/io/swagger/model/User.java | 174 +++++++++++++ .../java/io/swagger/api/JacksonConfig.java | 33 +++ .../java/io/swagger/api/RestApplication.java | 45 ++++ .../swagger/api/impl/PetApiServiceImpl.java | 53 ++++ .../swagger/api/impl/StoreApiServiceImpl.java | 35 +++ .../swagger/api/impl/UserApiServiceImpl.java | 51 ++++ .../eap/src/main/webapp/WEB-INF/jboss-web.xml | 3 + .../eap/src/main/webapp/WEB-INF/web.xml | 9 + 80 files changed, 4098 insertions(+), 6 deletions(-) create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/README.md create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/README.md create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/build.gradle create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/pom.xml create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/settings.gradle create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 8f97b524d7b..5d5c986d113 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -357,6 +357,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } if("joda".equals(dateLibrary)) { + additionalProperties.put("joda", "true"); typeMapping.put("date", "LocalDate"); typeMapping.put("DateTime", "DateTime"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java new file mode 100644 index 00000000000..f9c9cad1380 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java @@ -0,0 +1,231 @@ +package io.swagger.codegen.languages; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.BooleanUtils; + +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.CodegenResponse; +import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.JbossFeature; +import io.swagger.codegen.languages.features.SwaggerFeatures; +import io.swagger.models.Operation; + +public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen + implements JbossFeature, BeanValidationFeatures, SwaggerFeatures { + + protected boolean useBeanValidation = true; + protected boolean generateJbossDeploymentDescriptor = true; + protected boolean useSwaggerFeature = false; + + public JavaResteasyEapServerCodegen() { + + super(); + + artifactId = "swagger-jaxrs-resteasy-eap-server"; + + outputFolder = "generated-code/JavaJaxRS-Resteasy-eap"; + apiTemplateFiles.put("apiServiceImpl.mustache", ".java"); + apiTestTemplateFiles.clear(); // TODO: add test template + + // clear model and api doc template as AbstractJavaJAXRSServerCodegen + // does not support auto-generated markdown doc at the moment + //TODO: add doc templates + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + dateLibrary = "legacy";// TODO: change to joda + + embeddedTemplateDir = templateDir = "JavaJaxRS" + File.separator + "resteasy" + File.separator + "eap"; + + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, "Generate Jboss Deployment Descriptor")); + cliOptions.add(CliOption.newBoolean(USE_SWAGGER_FEATURE, "Use dynamic Swagger generator")); + + } + + @Override + public String getName() { + return "jaxrs-resteasy-eap"; + } + + @Override + public String getHelp() { + return "Generates a Java JAXRS-Resteasy Server application."; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)) { + boolean generateJbossDeploymentDescriptorProp = convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); + this.setGenerateJbossDeploymentDescriptor(generateJbossDeploymentDescriptorProp); + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + + if (additionalProperties.containsKey(USE_SWAGGER_FEATURE)) { + this.setUseSwaggerFeature(convertPropertyToBoolean(USE_SWAGGER_FEATURE)); + } + + if (useSwaggerFeature) { + writePropertyBack(USE_SWAGGER_FEATURE, useSwaggerFeature); + } + + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); + writeOptional(outputFolder, new SupportingFile("gradle.mustache", "", "build.gradle")); + writeOptional(outputFolder, new SupportingFile("settingsGradle.mustache", "", "settings.gradle")); + writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md")); + writeOptional(outputFolder, new SupportingFile("web.mustache", ("src/main/webapp/WEB-INF"), "web.xml")); + + supportingFiles.add(new SupportingFile("JacksonConfig.mustache", (projectFolder + File.separator + "java" + '/' + invokerPackage).replace(".", "/"), "JacksonConfig.java")); + + if (generateJbossDeploymentDescriptor) { + writeOptional(outputFolder, new SupportingFile("jboss-web.mustache", ("src/main/webapp/WEB-INF"), "jboss-web.xml")); + } + + writeOptional(outputFolder, new SupportingFile("RestApplication.mustache", (projectFolder + File.separator + "java" + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")); + + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + String basePath = resourcePath; + if (basePath.startsWith("/")) { + basePath = basePath.substring(1); + } + int pos = basePath.indexOf("/"); + if (pos > 0) { + basePath = basePath.substring(0, pos); + } + + if (basePath == "") { + basePath = "default"; + } else { + if (co.path.startsWith("/" + basePath)) { + co.path = co.path.substring(("/" + basePath).length()); + } + co.subresourceOperation = !co.path.isEmpty(); + } + List opList = operations.get(basePath); + if (opList == null) { + opList = new ArrayList(); + operations.put(basePath, opList); + } + opList.add(co); + co.baseName = basePath; + } + + @Override + public Map postProcessOperations(Map objs) { + + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + if (operation.hasConsumes == Boolean.TRUE) { + Map firstType = operation.consumes.get(0); + if (firstType != null) { + if ("multipart/form-data".equals(firstType.get("mediaType"))) { + operation.isMultipart = Boolean.TRUE; + } + } + } + List responses = operation.responses; + if (responses != null) { + for (CodegenResponse resp : responses) { + if ("0".equals(resp.code)) { + resp.code = "200"; + } + } + } + if (operation.returnType == null) { + operation.returnType = "Void"; + } else if (operation.returnType.startsWith("List")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("List<".length(), end).trim(); + operation.returnContainer = "List"; + } + } else if (operation.returnType.startsWith("Map")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); + operation.returnContainer = "Map"; + } + } else if (operation.returnType.startsWith("Set")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Set<".length(), end).trim(); + operation.returnContainer = "Set"; + } + } + } + } + return objs; + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + // Add imports for Jackson + if (!BooleanUtils.toBoolean(model.isEnum)) { + model.imports.add("JsonProperty"); + + if (BooleanUtils.toBoolean(model.hasEnums)) { + model.imports.add("JsonValue"); + } + } + } + + @Override + public Map postProcessModelsEnum(Map objs) { + objs = super.postProcessModelsEnum(objs); + + // Add imports for Jackson + List> imports = (List>) objs.get("imports"); + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + // for enum model + if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { + cm.imports.add(importMapping.get("JsonValue")); + Map item = new HashMap(); + item.put("import", importMapping.get("JsonValue")); + imports.add(item); + } + } + + return objs; + } + + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) { + this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor; + } + + public void setUseSwaggerFeature(boolean useSwaggerFeature) { + this.useSwaggerFeature = useSwaggerFeature; + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java index 6818c29059d..238b1daa950 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java @@ -4,7 +4,7 @@ public interface BeanValidationFeatures { // Language supports generating BeanValidation-Annotations public static final String USE_BEANVALIDATION = "useBeanValidation"; - + public void setUseBeanValidation(boolean useBeanValidation); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java index 78e4f3decc9..20e641b603c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java @@ -5,8 +5,7 @@ package io.swagger.codegen.languages.features; * */ public interface CXFServerFeatures - extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, - SwaggerUIFeatures + extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, SwaggerUIFeatures { public static final String USE_WADL_FEATURE = "useWadlFeature"; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java index 3f30fb075f3..b1638d63f8c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java @@ -4,7 +4,7 @@ public interface PerformBeanValidationFeatures { // Language supports performing BeanValidation public static final String PERFORM_BEANVALIDATION = "performBeanValidation"; - + public void setPerformBeanValidation(boolean performBeanValidation); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java index 0a3fad4202a..58b09ddb5d2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java @@ -14,5 +14,5 @@ public interface SpringFeatures extends BeanValidationFeatures { public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig); - + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java index f60b2391e03..3f10e4c0a9d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java @@ -1,6 +1,6 @@ package io.swagger.codegen.languages.features; -public interface SwaggerFeatures extends CXFFeatures { +public interface SwaggerFeatures { public static final String USE_SWAGGER_FEATURE = "useSwaggerFeature"; diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache new file mode 100644 index 00000000000..4b0f3d1efee --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache @@ -0,0 +1,39 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + +{{#java8}} + this.objectMapper.registerModule(new JavaTimeModule()); +{{/java8}} +{{#joda}} + this.objectMapper.registerModule(new JodaModule()); +{{/joda}} + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache new file mode 100644 index 00000000000..a0396fc3611 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache @@ -0,0 +1,19 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. + +You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. + +You can then view the swagger listing here: + +``` +http://localhost:{{serverPort}}{{contextPath}}/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache new file mode 100644 index 00000000000..a59c92e02f4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache @@ -0,0 +1,55 @@ +package {{invokerPackage}}; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; +{{#useSwaggerFeature}} +import io.swagger.jaxrs.config.BeanConfig; +{{/useSwaggerFeature}} + +{{#apiInfo}} +{{#apis}} +import {{invokerPackage}}.impl.{{classname}}ServiceImpl; +{{/apis}} +{{/apiInfo}} + +@ApplicationPath("/") +public class RestApplication extends Application { + +{{#useSwaggerFeature}} + public RestApplication() { + super(); + // Customize the dynamic contract + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setTitle("{{appName}}"); + beanConfig.setVersion("{{version}}"); + beanConfig.setSchemes(new String[] { "{{scheme}}" }); + beanConfig.setHost("{{host}}"); + beanConfig.setBasePath("{{basePathWithoutHost}}"); + beanConfig.setResourcePackage("{{invokerPackage}}"); + beanConfig.setScan(true); + + } +{{/useSwaggerFeature}} + + public Set> getClasses() { + Set> resources = new HashSet>(); +{{#apiInfo}} +{{#apis}} + resources.add({{classname}}ServiceImpl.class); +{{/apis}} +{{/apiInfo}} + +{{#useSwaggerFeature}} + resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); +{{/useSwaggerFeature}} + return resources; + } + + + + +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache new file mode 100644 index 00000000000..d9b9bd7de0b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -0,0 +1,50 @@ +package {{package}}; + +import {{modelPackage}}.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; +{{/isMultipart}}{{/operation}}{{/operations}} +@Path("/{{baseName}}") +{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} +{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} +@io.swagger.annotations.Api(description = "the {{baseName}} API") +{{>generatedAnnotation}} +{{#operations}} +public interface {{classname}} { + +{{#operation}} + @{{httpMethod}} + {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} + {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} + {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + @io.swagger.annotations.ApiResponses(value = { {{#responses}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + {{/hasMore}}{{/responses}} }) + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext); +{{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache new file mode 100644 index 00000000000..54167964d5a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache @@ -0,0 +1,28 @@ +package {{package}}.impl; + +import {{package}}.*; +import {{modelPackage}}.*; +{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; +{{/isMultipart}}{{/operation}}{{/operations}} + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}}ServiceImpl implements {{classname}} { + {{#operation}} + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + {{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache new file mode 100644 index 00000000000..2b28441d3d0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache new file mode 100644 index 00000000000..a9f78081ce5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache @@ -0,0 +1,24 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + + {{/-last}}{{#-last}}; + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + private {{datatype}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache new file mode 100644 index 00000000000..7aea7b92f22 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache @@ -0,0 +1,3 @@ +public enum {{classname}} { + {{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache new file mode 100644 index 00000000000..09c149b8ade --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache new file mode 100644 index 00000000000..a47b6faa85b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache @@ -0,0 +1 @@ +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache new file mode 100644 index 00000000000..ae34de08166 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -0,0 +1,32 @@ +apply plugin: 'war' + +project.version = "{{artifactVersion}}" +project.group = "{{groupId}}" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' +{{#joda}} + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' +{{/joda}} + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache new file mode 100644 index 00000000000..1360d796826 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache new file mode 100644 index 00000000000..788fc867d92 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache @@ -0,0 +1,3 @@ + + {{contextPath}} + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache new file mode 100644 index 00000000000..2ff294581f5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache @@ -0,0 +1,22 @@ +package {{package}}; + +import java.util.Objects; +import java.util.ArrayList; +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache new file mode 100644 index 00000000000..0cd6809df54 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache new file mode 100644 index 00000000000..827917bd88e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache @@ -0,0 +1,70 @@ +import io.swagger.annotations.*; + +{{#description}}@ApiModel(description="{{{description}}}"){{/description}} +{{>generatedAnnotation}} +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { + {{#vars}}{{#isEnum}} + +{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} + +{{>enumClass}}{{/items}}{{/items.isEnum}} + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}} + + {{#vars}} + /**{{#description}} + * {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + **/ + {{#vendorExtensions.extraAnnotation}}{{{vendorExtensions.extraAnnotation}}}{{/vendorExtensions.extraAnnotation}} + @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @JsonProperty("{{baseName}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + {{/vars}} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + {{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}} + return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}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/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache new file mode 100644 index 00000000000..17cda56818f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -0,0 +1,184 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + war + {{artifactId}} + {{artifactVersion}} + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + +{{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + +{{/useBeanValidation}} +{{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.1.1 + +{{/joda}} +{{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.6.3 + +{{/java8}} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.9 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache new file mode 100644 index 00000000000..5a9a4398a03 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache new file mode 100644 index 00000000000..e44ab167e8f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache new file mode 100644 index 00000000000..bd03573d196 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache new file mode 100644 index 00000000000..6829cf8c7a6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache new file mode 100644 index 00000000000..ff79730471d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache new file mode 100644 index 00000000000..b8fd6c4c41f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache @@ -0,0 +1 @@ +rootProject.name = "{{artifactId}}" \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache new file mode 100644 index 00000000000..df744af490e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 876409b50b4..2586fac929e 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -17,6 +17,7 @@ io.swagger.codegen.languages.JavaJerseyServerCodegen io.swagger.codegen.languages.JavaCXFClientCodegen io.swagger.codegen.languages.JavaCXFServerCodegen io.swagger.codegen.languages.JavaResteasyServerCodegen +io.swagger.codegen.languages.JavaResteasyEapServerCodegen io.swagger.codegen.languages.JavaJAXRSSpecServerCodegen io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen io.swagger.codegen.languages.JavaInflectorServerCodegen diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java new file mode 100644 index 00000000000..009076bc2e7 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java @@ -0,0 +1,77 @@ +package io.swagger.codegen.jaxrs; + +import io.swagger.codegen.AbstractOptionsTest; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.languages.JavaResteasyEapServerCodegen; +import io.swagger.codegen.options.JavaResteasyEapServerOptionsProvider; +import io.swagger.codegen.options.OptionsProvider; +import mockit.Expectations; +import mockit.Tested; + +public class JavaResteasyEapServerOptionsTest extends AbstractOptionsTest { + + @Tested + private JavaResteasyEapServerCodegen clientCodegen; + + public JavaResteasyEapServerOptionsTest() { + super(new JavaResteasyEapServerOptionsProvider()); + } + + protected JavaResteasyEapServerOptionsTest(OptionsProvider optionsProvider) { + super(optionsProvider); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @Override + protected void setExpectations() { + new Expectations(clientCodegen) { + { + clientCodegen.setModelPackage(JavaResteasyEapServerOptionsProvider.MODEL_PACKAGE_VALUE); + times = 1; + clientCodegen.setApiPackage(JavaResteasyEapServerOptionsProvider.API_PACKAGE_VALUE); + times = 1; + clientCodegen.setSortParamsByRequiredFlag( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.SORT_PARAMS_VALUE)); + times = 1; + clientCodegen.setInvokerPackage(JavaResteasyEapServerOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; + clientCodegen.setGroupId(JavaResteasyEapServerOptionsProvider.GROUP_ID_VALUE); + times = 1; + clientCodegen.setArtifactId(JavaResteasyEapServerOptionsProvider.ARTIFACT_ID_VALUE); + times = 1; + clientCodegen.setArtifactVersion(JavaResteasyEapServerOptionsProvider.ARTIFACT_VERSION_VALUE); + times = 1; + clientCodegen.setSourceFolder(JavaResteasyEapServerOptionsProvider.SOURCE_FOLDER_VALUE); + times = 1; + clientCodegen.setLocalVariablePrefix(JavaResteasyEapServerOptionsProvider.LOCAL_PREFIX_VALUE); + times = 1; + clientCodegen.setSerializableModel( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.SERIALIZABLE_MODEL_VALUE)); + times = 1; + clientCodegen + .setFullJavaUtil(Boolean.valueOf(JavaResteasyEapServerOptionsProvider.FULL_JAVA_UTIL_VALUE)); + times = 1; + clientCodegen.setSerializeBigDecimalAsString(true); + times = 1; + + clientCodegen.setGenerateJbossDeploymentDescriptor( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)); + times = 1; + + // no invocation as it is already defined as true in JavaResteasyEapServerCodegen + // clientCodegen + // .setUseBeanValidation(Boolean.valueOf(JavaResteasyEapServerOptionsProvider.USE_BEANVALIDATION)); + // times = 1; + clientCodegen + .setUseSwaggerFeature( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.USE_SWAGGER_FEATURE)); + times = 1; + + } + }; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java new file mode 100644 index 00000000000..7e9bffb33c4 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java @@ -0,0 +1,50 @@ +package io.swagger.codegen.options; + +import java.util.Map; + +import com.google.common.collect.ImmutableMap; + +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.languages.JavaCXFServerCodegen; +import io.swagger.codegen.languages.JavaResteasyEapServerCodegen; +import io.swagger.codegen.languages.JavaResteasyServerCodegen; + +public class JavaResteasyEapServerOptionsProvider extends JavaOptionsProvider { + + public static final String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "true"; + + public static final String IMPL_FOLDER_VALUE = "src/main/java"; + + public static final String USE_BEANVALIDATION = "true"; + + public static final String USE_SWAGGER_FEATURE = "true"; + + @Override + public boolean isServer() { + return true; + } + + @Override + public String getLanguage() { + return "jaxrs-resteasy-eap"; + } + + @Override + public Map createOptions() { + + Map parentOptions = super.createOptions(); + + ImmutableMap.Builder builder = new ImmutableMap.Builder() + .putAll(parentOptions); + + builder.put(CodegenConstants.IMPL_FOLDER, IMPL_FOLDER_VALUE); + builder.put("title", "Test title"); + + builder.put(JavaCXFServerCodegen.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); + builder.put(JavaResteasyServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + builder.put(JavaResteasyEapServerCodegen.USE_SWAGGER_FEATURE, USE_SWAGGER_FEATURE); + + return builder.build(); + + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md new file mode 100644 index 00000000000..cc011c37ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md @@ -0,0 +1,23 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle new file mode 100644 index 00000000000..ed888aecd20 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'war' + +project.version = "1.0.0" +project.group = "io.swagger" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml new file mode 100644 index 00000000000..3e75cf3b537 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -0,0 +1,173 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-resteasy-eap-server + war + swagger-jaxrs-resteasy-eap-server + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.1.1 + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.9 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle new file mode 100644 index 00000000000..1bd07384c31 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-jaxrs-resteasy-eap-server" \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..22a0cb0a5ca --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,143 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + +@Path("/pet") + + +@io.swagger.annotations.Api(description = "the pet API") + +public interface PetApi { + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..2d23dba5649 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,70 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/store") + + +@io.swagger.annotations.Api(description = "the store API") + +public interface StoreApi { + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory(@Context SecurityContext securityContext); + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..5909038e544 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,102 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/user") + + +@io.swagger.annotations.Api(description = "the user API") + +public interface UserApi { + + @POST + + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + @POST + @Path("/createWithArray") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST + @Path("/createWithList") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET + @Path("/logout") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response logoutUser(@Context SecurityContext securityContext); + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..caf0d5f1631 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..ac14219acb6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..0099184b5ae --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,169 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import org.joda.time.DateTime; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private DateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public DateTime getShipDate() { + return shipDate; + } + public void setShipDate(DateTime shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..5dbbc692373 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,173 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.List; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A pet for sale in the pet store") + +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList(); + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..43ea83e43fc --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..f238a851d7c --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,174 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java new file mode 100644 index 00000000000..2cf35d3d1e6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java @@ -0,0 +1,34 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + + this.objectMapper.registerModule(new JodaModule()); + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..cb15c187c32 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java @@ -0,0 +1,31 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; + +import io.swagger.api.impl.PetApiServiceImpl; +import io.swagger.api.impl.StoreApiServiceImpl; +import io.swagger.api.impl.UserApiServiceImpl; + +@ApplicationPath("/") +public class RestApplication extends Application { + + public Set> getClasses() { + Set> resources = new HashSet>(); + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + //resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + //resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); + + return resources; + } + + + + +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..eb3e35b8280 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,53 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class PetApiServiceImpl implements PetApi { + public Response addPet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByStatus(List status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByTags(List tags,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getPetById(Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..1de821ace75 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,35 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getOrderById(Long orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response placeOrder(Order body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..67f74c66cb0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,51 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class UserApiServiceImpl implements UserApi { + public Response createUser(User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deleteUser(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getUserByName(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response loginUser(String username,String password,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updateUser(String username,User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 00000000000..9c05ed07b78 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,3 @@ + + /v2 + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..889fb80870a --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/eap/README.md b/samples/server/petstore/jaxrs-resteasy/eap/README.md new file mode 100644 index 00000000000..cc011c37ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/README.md @@ -0,0 +1,23 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle new file mode 100644 index 00000000000..879fe11de18 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'war' + +project.version = "1.0.0" +project.group = "io.swagger" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml new file mode 100644 index 00000000000..c82aa0de05d --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -0,0 +1,168 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-resteasy-eap-server + war + swagger-jaxrs-resteasy-eap-server + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.9 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle b/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle new file mode 100644 index 00000000000..1bd07384c31 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-jaxrs-resteasy-eap-server" \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..22a0cb0a5ca --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,143 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + +@Path("/pet") + + +@io.swagger.annotations.Api(description = "the pet API") + +public interface PetApi { + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..2d23dba5649 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,70 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/store") + + +@io.swagger.annotations.Api(description = "the store API") + +public interface StoreApi { + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory(@Context SecurityContext securityContext); + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..5909038e544 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,102 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/user") + + +@io.swagger.annotations.Api(description = "the user API") + +public interface UserApi { + + @POST + + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + @POST + @Path("/createWithArray") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST + @Path("/createWithList") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET + @Path("/logout") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response logoutUser(@Context SecurityContext securityContext); + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..caf0d5f1631 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..ac14219acb6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..b1870b87340 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,169 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import java.util.Date; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private Date shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..5dbbc692373 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,173 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.List; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A pet for sale in the pet store") + +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList(); + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..43ea83e43fc --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..f238a851d7c --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,174 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java new file mode 100644 index 00000000000..8b6f49d4345 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java @@ -0,0 +1,33 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..74de91ef989 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; +import io.swagger.jaxrs.config.BeanConfig; + +import io.swagger.api.impl.PetApiServiceImpl; +import io.swagger.api.impl.StoreApiServiceImpl; +import io.swagger.api.impl.UserApiServiceImpl; + +@ApplicationPath("/") +public class RestApplication extends Application { + + public RestApplication() { + super(); + // Customize the dynamic contract + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setTitle("Swagger Petstore"); + beanConfig.setVersion("1.0.0"); + beanConfig.setSchemes(new String[] { "http" }); + beanConfig.setHost("petstore.swagger.io"); + beanConfig.setBasePath("/v2"); + beanConfig.setResourcePackage("io.swagger.api"); + beanConfig.setScan(true); + + } + + public Set> getClasses() { + Set> resources = new HashSet>(); + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); + return resources; + } + + + + +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..eb3e35b8280 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,53 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class PetApiServiceImpl implements PetApi { + public Response addPet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByStatus(List status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByTags(List tags,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getPetById(Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..1de821ace75 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,35 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getOrderById(Long orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response placeOrder(Order body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..67f74c66cb0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,51 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class UserApiServiceImpl implements UserApi { + public Response createUser(User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deleteUser(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getUserByName(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response loginUser(String username,String password,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updateUser(String username,User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 00000000000..9c05ed07b78 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,3 @@ + + /v2 + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..889fb80870a --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + From 77c5b90b0024717678702d0e25960d9d21fcfed9 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 1 Mar 2017 12:17:01 +0800 Subject: [PATCH 019/132] add creator of JAX-RS RestEasy (JBoss EAP) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b5c3886edf5..bb27e158b3b 100644 --- a/README.md +++ b/README.md @@ -1007,6 +1007,7 @@ Here is a list of template creators: * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard + * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsum * PHP Slim: @jfastnacht * PHP Zend Expressive (with Path Handler): @Articus From 35be2bc1237a3ce3a753bc9b6243811a1cc58cfc Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 08:46:42 -0500 Subject: [PATCH 020/132] updated parser version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 063b84da50d..3ebea1af254 100644 --- a/pom.xml +++ b/pom.xml @@ -863,7 +863,7 @@ - 1.0.26-SNAPSHOT + 1.0.26 2.11.1 2.3.4 1.5.12 From 894f272f8978a7b6362bf3533463e35e61fee4d6 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 08:51:18 -0500 Subject: [PATCH 021/132] updated core versions --- .../src/main/resources/Java/libraries/feign/pom.mustache | 2 +- .../src/main/resources/Java/libraries/jersey2/pom.mustache | 2 +- .../src/main/resources/Java/libraries/okhttp-gson/pom.mustache | 2 +- .../src/main/resources/Java/libraries/retrofit/pom.mustache | 2 +- .../src/main/resources/Java/libraries/retrofit2/pom.mustache | 2 +- .../src/main/resources/JavaInflector/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/server/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache | 2 +- .../swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/pom.mustache | 2 +- .../resources/JavaSpring/libraries/spring-cloud/pom.mustache | 2 +- modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache | 2 +- .../swagger-codegen/src/main/resources/akka-scala/pom.mustache | 2 +- modules/swagger-codegen/src/main/resources/android/pom.mustache | 2 +- modules/swagger-codegen/src/main/resources/scala/pom.mustache | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index bd0a392256f..584466ed695 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -235,7 +235,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 8.17.0 2.0.2 2.7.5 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index 17d8943c822..ca467aa29ba 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -271,7 +271,7 @@ - 1.5.9 + 1.5.12 2.22.2 2.7.5 {{^java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 40cbe01c0bc..40ec4f345e3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -230,7 +230,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 2.9.3 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index 427cc514416..05c0e7dbe3a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -212,7 +212,7 @@ - 1.5.9 + 1.5.12 1.9.0 2.7.5 2.9.3 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index 2434c0da20d..76c416904cb 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -261,7 +261,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 {{#usePlay24WS}} 2.7.5 diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache index 4d7bc8c2647..1cd3be1a531 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache @@ -119,7 +119,7 @@ 1.0.0 - 1.0.8 + 1.0.11 9.2.9.v20150224 1.0.1 4.8.2 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache index 6e0736b368a..4ddb4c6e331 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -166,7 +166,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 5c976dc4f10..386f337867a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -217,7 +217,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.10 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 26b934f2722..96e7f6a7ce1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -181,7 +181,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 1.19.1 1.7.21 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index d5ff9b0055a..5338a135256 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -178,7 +178,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 {{#supportJava6}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 17cda56818f..7b7107f197a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -174,7 +174,7 @@ - 1.5.9 + 1.5.12 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache index c5699ecf00c..c9ed5939322 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -159,7 +159,7 @@ - 1.5.9 + 1.5.12 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index f5a84b30911..b79762090a9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -9,7 +9,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 org.springframework.boot diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache index 7839f9c1ec2..beab949c29d 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache @@ -81,7 +81,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache index ea666198674..8c8c377ee7f 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache @@ -217,7 +217,7 @@ 2.3.9 1.2 2.2 - 1.5.9 + 1.5.12 1.0.0 4.8.1 diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index e073253123d..758e9d62d07 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -145,7 +145,7 @@ - 1.5.9 + 1.5.12 2.3.1 4.8.1 1.0.0 diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index e6d80631460..742693511d1 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -210,7 +210,7 @@ 1.2 2.2 1.19 - 1.5.9 + 1.5.12 1.0.5 1.0.0 2.4.2 From 041da8998a50da0845671df3241a3ba4a44e7392 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:55:42 -0500 Subject: [PATCH 022/132] rebuilt --- samples/client/petstore/java/feign/pom.xml | 2 +- samples/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/client/petstore/java/jersey2/pom.xml | 2 +- samples/client/petstore/java/okhttp-gson/pom.xml | 2 +- samples/client/petstore/java/retrofit/pom.xml | 2 +- samples/client/petstore/java/retrofit2-play24/pom.xml | 2 +- samples/client/petstore/java/retrofit2/pom.xml | 2 +- samples/client/petstore/java/retrofit2rx/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 9ed227ceae1..b8b7c6d85a0 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -235,7 +235,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 8.17.0 2.0.2 2.7.5 diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index be696a53993..ac527b7d825 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -238,7 +238,7 @@ - 1.5.9 + 1.5.12 2.22.2 2.7.5 1.0.0 diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 1ead3565719..e4e73cfc097 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -243,7 +243,7 @@ - 1.5.9 + 1.5.12 2.22.2 2.7.5 2.9.4 diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 94bb8b01303..26751c4e3af 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -206,7 +206,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 2.9.3 diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index 5d23171a297..aaa9654d87a 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -212,7 +212,7 @@ - 1.5.9 + 1.5.12 1.9.0 2.7.5 2.9.3 diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index e4770b057d9..54db6cdee8d 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -245,7 +245,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 2.7.5 2.9.4 diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index a0f8bd0efae..46705e6f4c3 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -214,7 +214,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 2.9.4 1.0.1 diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 14ed953e828..ed74e3e89e5 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -224,7 +224,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 1.1.6 2.9.4 From af2749325da81724a4775cfca7fa4626fb45c0f4 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:56:42 -0500 Subject: [PATCH 023/132] rebuilt --- .../src/gen/java/io/swagger/model/Category.java | 4 ++-- .../gen/java/io/swagger/model/ModelApiResponse.java | 4 ++-- .../src/gen/java/io/swagger/model/Order.java | 4 ++-- .../src/gen/java/io/swagger/model/Pet.java | 4 ++-- .../src/gen/java/io/swagger/model/Tag.java | 4 ++-- .../src/gen/java/io/swagger/model/User.java | 4 ++-- samples/server/petstore/jaxrs-cxf-cdi/swagger.json | 10 +++++----- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index fee23f1bfaf..6359d8b0df5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -57,7 +57,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index 39d83d433e5..d8495139bb3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -75,7 +75,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -109,7 +109,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 21e1acca64d..1351a2a8fad 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -163,7 +163,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -203,7 +203,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index c346608f0c8..284fc469e8e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -169,7 +169,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -209,7 +209,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index f60b51d5397..0efd1fee3f2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -57,7 +57,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 2548a22c89c..935f0b642eb 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -166,7 +166,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index 18ccb05b4ba..90ab55a1618 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -636,6 +636,11 @@ } }, "securityDefinitions" : { + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + }, "petstore_auth" : { "type" : "oauth2", "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -644,11 +649,6 @@ "write:pets" : "modify pets in your account", "read:pets" : "read your pets" } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" } }, "definitions" : { From 2cec6192a4994743391d60ca26f6143f088da880 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:57:38 -0500 Subject: [PATCH 024/132] rebuilt --- .../src/gen/java/io/swagger/api/PetApi.java | 6 +- .../src/gen/java/io/swagger/api/StoreApi.java | 2 + .../src/gen/java/io/swagger/api/UserApi.java | 4 +- .../gen/java/io/swagger/model/Category.java | 17 +++++- .../io/swagger/model/ModelApiResponse.java | 24 +++++++- .../src/gen/java/io/swagger/model/Order.java | 47 ++++++++++++++- .../src/gen/java/io/swagger/model/Pet.java | 59 ++++++++++++++++++- .../src/gen/java/io/swagger/model/Tag.java | 17 +++++- .../src/gen/java/io/swagger/model/User.java | 59 ++++++++++++++++++- 9 files changed, 224 insertions(+), 11 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java index 524bc0085c1..ede723f3935 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/v2") @Api(value = "/", description = "") @@ -37,13 +39,13 @@ public interface PetApi { @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) - public List findPetsByStatus(@QueryParam("status")List status); + public List findPetsByStatus(@QueryParam("status") @NotNull List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) - public List findPetsByTags(@QueryParam("tags")List tags); + public List findPetsByTags(@QueryParam("tags") @NotNull List tags); @GET @Path("/pet/{petId}") diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java index 747f772dad3..8462b041b30 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/v2") @Api(value = "/", description = "") diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java index 94d94a703fa..a6d362e3775 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/v2") @Api(value = "/", description = "") @@ -53,7 +55,7 @@ public interface UserApi { @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ "user", }) - public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); + public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); @GET @Path("/user/logout") diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java index 591a6e22a69..deaf2da1115 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -26,9 +27,16 @@ public class Category { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Category id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +44,17 @@ public class Category { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Category name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -55,7 +70,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java index f3c6f56cfc4..d8074c75102 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -28,9 +29,16 @@ public class ModelApiResponse { public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + /** * Get type * @return type @@ -38,9 +46,16 @@ public class ModelApiResponse { public String getType() { return type; } + public void setType(String type) { this.type = type; } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + /** * Get message * @return message @@ -48,10 +63,17 @@ public class ModelApiResponse { public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -68,7 +90,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index af6f5e0e38e..18ede7173c2 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -27,7 +28,7 @@ public class Order { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); +@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -67,9 +68,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Order id(Long id) { + this.id = id; + return this; + } + /** * Get petId * @return petId @@ -77,9 +85,16 @@ public enum StatusEnum { public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + /** * Get quantity * @return quantity @@ -87,9 +102,16 @@ public enum StatusEnum { public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + /** * Get shipDate * @return shipDate @@ -97,9 +119,16 @@ public enum StatusEnum { public javax.xml.datatype.XMLGregorianCalendar getShipDate() { return shipDate; } + public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { this.shipDate = shipDate; } + + public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { + this.shipDate = shipDate; + return this; + } + /** * Order Status * @return status @@ -107,9 +136,16 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + /** * Get complete * @return complete @@ -117,10 +153,17 @@ public enum StatusEnum { public Boolean getComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +183,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java index 0cfc0a30ee0..bb02aa5ea2c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java @@ -5,6 +5,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -33,7 +34,7 @@ public class Pet { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); +@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -71,9 +72,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Pet id(Long id) { + this.id = id; + return this; + } + /** * Get category * @return category @@ -81,29 +89,57 @@ public enum StatusEnum { public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + public Pet category(Category category) { + this.category = category; + return this; + } + /** * Get name * @return name **/ + @NotNull public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public Pet name(String name) { + this.name = name; + return this; + } + /** * Get photoUrls * @return photoUrls **/ + @NotNull public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + /** * Get tags * @return tags @@ -111,9 +147,21 @@ public enum StatusEnum { public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + /** * pet status in the store * @return status @@ -121,10 +169,17 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,7 +199,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java index 4eb99ad2fc1..caf601e42cf 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -26,9 +27,16 @@ public class Tag { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Tag id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +44,17 @@ public class Tag { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Tag name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -55,7 +70,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java index 005d9aa8c74..5cfc2944314 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -38,9 +39,16 @@ public class User { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public User id(Long id) { + this.id = id; + return this; + } + /** * Get username * @return username @@ -48,9 +56,16 @@ public class User { public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + public User username(String username) { + this.username = username; + return this; + } + /** * Get firstName * @return firstName @@ -58,9 +73,16 @@ public class User { public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + /** * Get lastName * @return lastName @@ -68,9 +90,16 @@ public class User { public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + /** * Get email * @return email @@ -78,9 +107,16 @@ public class User { public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + public User email(String email) { + this.email = email; + return this; + } + /** * Get password * @return password @@ -88,9 +124,16 @@ public class User { public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + public User password(String password) { + this.password = password; + return this; + } + /** * Get phone * @return phone @@ -98,9 +141,16 @@ public class User { public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + public User phone(String phone) { + this.phone = phone; + return this; + } + /** * User Status * @return userStatus @@ -108,10 +158,17 @@ public class User { public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,7 +190,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } From c9c9d9a2589193cb88276c6640babfd995c24436 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:58:17 -0500 Subject: [PATCH 025/132] rebuilt --- .../src/gen/java/io/swagger/api/PetApi.java | 6 +- .../src/gen/java/io/swagger/api/StoreApi.java | 2 + .../src/gen/java/io/swagger/api/UserApi.java | 4 +- .../gen/java/io/swagger/model/Category.java | 17 +++++- .../io/swagger/model/ModelApiResponse.java | 24 +++++++- .../src/gen/java/io/swagger/model/Order.java | 47 ++++++++++++++- .../src/gen/java/io/swagger/model/Pet.java | 59 ++++++++++++++++++- .../src/gen/java/io/swagger/model/Tag.java | 17 +++++- .../src/gen/java/io/swagger/model/User.java | 59 ++++++++++++++++++- 9 files changed, 224 insertions(+), 11 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java index 4ef2db0e204..d42bf02c74f 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/") @Api(value = "/", description = "") @@ -37,13 +39,13 @@ public interface PetApi { @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) - public List findPetsByStatus(@QueryParam("status")List status); + public List findPetsByStatus(@QueryParam("status") @NotNull List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) - public List findPetsByTags(@QueryParam("tags")List tags); + public List findPetsByTags(@QueryParam("tags") @NotNull List tags); @GET @Path("/pet/{petId}") diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java index e26c47769b4..4a3ffd1020b 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/") @Api(value = "/", description = "") diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java index a51b1fe0c70..a28cc95b58d 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; @Path("/") @Api(value = "/", description = "") @@ -53,7 +55,7 @@ public interface UserApi { @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ "user", }) - public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); + public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); @GET @Path("/user/logout") diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java index 591a6e22a69..deaf2da1115 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -26,9 +27,16 @@ public class Category { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Category id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +44,17 @@ public class Category { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Category name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -55,7 +70,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java index f3c6f56cfc4..d8074c75102 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -28,9 +29,16 @@ public class ModelApiResponse { public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + /** * Get type * @return type @@ -38,9 +46,16 @@ public class ModelApiResponse { public String getType() { return type; } + public void setType(String type) { this.type = type; } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + /** * Get message * @return message @@ -48,10 +63,17 @@ public class ModelApiResponse { public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -68,7 +90,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index af6f5e0e38e..18ede7173c2 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -27,7 +28,7 @@ public class Order { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); +@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -67,9 +68,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Order id(Long id) { + this.id = id; + return this; + } + /** * Get petId * @return petId @@ -77,9 +85,16 @@ public enum StatusEnum { public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + /** * Get quantity * @return quantity @@ -87,9 +102,16 @@ public enum StatusEnum { public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + /** * Get shipDate * @return shipDate @@ -97,9 +119,16 @@ public enum StatusEnum { public javax.xml.datatype.XMLGregorianCalendar getShipDate() { return shipDate; } + public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { this.shipDate = shipDate; } + + public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { + this.shipDate = shipDate; + return this; + } + /** * Order Status * @return status @@ -107,9 +136,16 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + /** * Get complete * @return complete @@ -117,10 +153,17 @@ public enum StatusEnum { public Boolean getComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +183,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java index 0cfc0a30ee0..bb02aa5ea2c 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java @@ -5,6 +5,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -33,7 +34,7 @@ public class Pet { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); +@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -71,9 +72,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Pet id(Long id) { + this.id = id; + return this; + } + /** * Get category * @return category @@ -81,29 +89,57 @@ public enum StatusEnum { public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + public Pet category(Category category) { + this.category = category; + return this; + } + /** * Get name * @return name **/ + @NotNull public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public Pet name(String name) { + this.name = name; + return this; + } + /** * Get photoUrls * @return photoUrls **/ + @NotNull public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + /** * Get tags * @return tags @@ -111,9 +147,21 @@ public enum StatusEnum { public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + /** * pet status in the store * @return status @@ -121,10 +169,17 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,7 +199,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java index 4eb99ad2fc1..caf601e42cf 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -26,9 +27,16 @@ public class Tag { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Tag id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +44,17 @@ public class Tag { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Tag name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -55,7 +70,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java index 005d9aa8c74..5cfc2944314 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -38,9 +39,16 @@ public class User { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public User id(Long id) { + this.id = id; + return this; + } + /** * Get username * @return username @@ -48,9 +56,16 @@ public class User { public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + public User username(String username) { + this.username = username; + return this; + } + /** * Get firstName * @return firstName @@ -58,9 +73,16 @@ public class User { public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + /** * Get lastName * @return lastName @@ -68,9 +90,16 @@ public class User { public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + /** * Get email * @return email @@ -78,9 +107,16 @@ public class User { public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + public User email(String email) { + this.email = email; + return this; + } + /** * Get password * @return password @@ -88,9 +124,16 @@ public class User { public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + public User password(String password) { + this.password = password; + return this; + } + /** * Get phone * @return phone @@ -98,9 +141,16 @@ public class User { public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + public User phone(String phone) { + this.phone = phone; + return this; + } + /** * User Status * @return userStatus @@ -108,10 +158,17 @@ public class User { public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,7 +190,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } From 9aeedca4c372e09bc082f96336df259e4f4a7164 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:58:53 -0500 Subject: [PATCH 026/132] rebuilt --- .../gen/java/io/swagger/model/AdditionalPropertiesClass.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java | 2 +- .../src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java | 2 +- .../src/gen/java/io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/Category.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/Client.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java | 2 +- .../src/gen/java/io/swagger/model/HasOnlyReadOnly.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java | 2 +- .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 2 +- .../src/gen/java/io/swagger/model/Model200Response.java | 2 +- .../src/gen/java/io/swagger/model/ModelApiResponse.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java | 2 +- .../jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java | 2 +- .../src/gen/java/io/swagger/model/SpecialModelName.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java | 2 +- .../petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 556e9e1d61a..b19a90cbc3f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -81,7 +81,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java index 08ed3535947..36c52fa27aa 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -71,7 +71,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java index 93ad619c46c..b9ceb010054 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -31,7 +31,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 681f477f8e8..4d994a64f4c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 8e06ba9fd53..45348bd5bab 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java index bab67b5f1ac..48a352899b8 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -106,7 +106,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java index 9c96e900b7f..2dc50b68a86 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -148,7 +148,7 @@ public class Capitalization { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java index 12ff2e0743f..a44b4c3474e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -49,7 +49,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index c4de6207ff9..206fb962639 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -68,7 +68,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java index d924d868929..522a5f5c835 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -50,7 +50,7 @@ public class ClassModel { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java index cde45a9e668..effac40b532 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -48,7 +48,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java index 79f363fd80e..c33b9754f29 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -49,7 +49,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java index 31adcdc2086..1f72d296c0f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -141,7 +141,7 @@ public enum ArrayEnumEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java index b6e382ed1f6..550742ed624 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -208,7 +208,7 @@ public enum EnumNumberEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index d544cfa112f..01bfba5b814 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -317,7 +317,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 8acb48cf2cb..e775fe7aab3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -52,7 +52,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java index 3c1e80e9d83..f851274f064 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -114,7 +114,7 @@ public enum InnerEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2dcc59c4803..e22fda79803 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -98,7 +98,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java index 4a2183a1ca6..5d7bf7f6a12 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -70,7 +70,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index e25bfd0dbdf..ddf2aa0b5a5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java index cf9cb2cc74d..f1fd55b763b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -50,7 +50,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java index 90deb77334d..1365022268b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -95,7 +95,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java index 219cf8612ff..203830ffd01 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -49,7 +49,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index 4a7622e7948..83e24c1ffe9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -181,7 +181,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 3046295eeaf..41c96154a4b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -197,7 +197,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java index f870573ac4d..769ab0a7c48 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -60,7 +60,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java index b3decaa2221..a4b52b3bfe2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -48,7 +48,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index 9a2ffa38409..de1cd154399 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -68,7 +68,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index e25dba5282e..9c4b9d9ae7d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -188,7 +188,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } From 89168d5e898a60e137283077da7e251b35c52267 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 09:59:27 -0500 Subject: [PATCH 027/132] rebuilt --- samples/server/petstore/jaxrs/jersey2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 18310a4ec6a..989fa6f95d5 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -163,7 +163,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 From 40da4769b0b8dc55270e3fbeca8030168fc39707 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 10:01:50 -0500 Subject: [PATCH 028/132] rebuilt --- .../default/src/gen/java/io/swagger/model/Category.java | 4 ++-- .../src/gen/java/io/swagger/model/ModelApiResponse.java | 4 ++-- .../default/src/gen/java/io/swagger/model/Order.java | 4 ++-- .../default/src/gen/java/io/swagger/model/Pet.java | 4 ++-- .../default/src/gen/java/io/swagger/model/Tag.java | 4 ++-- .../default/src/gen/java/io/swagger/model/User.java | 4 ++-- .../joda/src/gen/java/io/swagger/api/PetApi.java | 5 +++-- .../joda/src/gen/java/io/swagger/api/StoreApi.java | 3 ++- .../joda/src/gen/java/io/swagger/api/UserApi.java | 3 ++- .../joda/src/gen/java/io/swagger/model/Category.java | 6 +++--- .../src/gen/java/io/swagger/model/ModelApiResponse.java | 6 +++--- .../joda/src/gen/java/io/swagger/model/Order.java | 6 +++--- .../joda/src/gen/java/io/swagger/model/Pet.java | 8 +++++--- .../joda/src/gen/java/io/swagger/model/Tag.java | 6 +++--- .../joda/src/gen/java/io/swagger/model/User.java | 6 +++--- 15 files changed, 39 insertions(+), 34 deletions(-) diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java index caf0d5f1631..6794ae0da5a 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java @@ -41,7 +41,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java index ac14219acb6..2de59f1191e 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -54,7 +54,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java index b1870b87340..4e9acd44a95 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java @@ -119,7 +119,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -159,7 +159,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java index 5dbbc692373..81ea1ca0b24 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java @@ -123,7 +123,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -163,7 +163,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java index 43ea83e43fc..f6894199956 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java @@ -41,7 +41,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java index f238a851d7c..0c2be106305 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java @@ -120,7 +120,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -164,7 +164,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java index 2fa28650813..7586f8cfed8 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java @@ -20,6 +20,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; +import javax.validation.constraints.*; import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; @Path("/pet") @@ -76,7 +77,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByStatus( @QueryParam("status") List status,@Context SecurityContext securityContext) + public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } @@ -94,7 +95,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags( @QueryParam("tags") List tags,@Context SecurityContext securityContext) + public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java index ba55d564ecb..f8ef1c59ade 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java @@ -19,6 +19,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; +import javax.validation.constraints.*; @Path("/store") @@ -65,7 +66,7 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - public Response getOrderById( @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java index 86a5c0fff24..5790caaa4b2 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java @@ -19,6 +19,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; +import javax.validation.constraints.*; @Path("/user") @@ -98,7 +99,7 @@ public class UserApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) - public Response loginUser( @QueryParam("username") String username, @QueryParam("password") String password,@Context SecurityContext securityContext) + public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username,password,securityContext); } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java index 3bab12c8a0f..6794ae0da5a 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="A category for a pet") @@ -41,7 +41,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java index 531fe3d6691..2de59f1191e 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") @@ -54,7 +54,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java index dc4113c030b..5d4300d15f4 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import org.joda.time.DateTime; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") @@ -119,7 +119,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -159,7 +159,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java index aa25b02712a..81ea1ca0b24 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") @@ -75,6 +75,7 @@ public class Pet { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull public String getName() { return name; } @@ -87,6 +88,7 @@ public class Pet { @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("photoUrls") + @NotNull public List getPhotoUrls() { return photoUrls; } @@ -121,7 +123,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -161,7 +163,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java index 4704ab3e197..f6894199956 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") @@ -41,7 +41,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java index 6e9ebf31d76..0c2be106305 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; - +import javax.validation.constraints.*; import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") @@ -120,7 +120,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -164,7 +164,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } From 4499a3c74c1bfc8e457be6ba71e0ee3717036737 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 10:02:42 -0500 Subject: [PATCH 029/132] rebuilt --- .../model/AdditionalPropertiesClass.java | 4 ++-- .../src/gen/java/io/swagger/model/Animal.java | 4 ++-- .../gen/java/io/swagger/model/AnimalFarm.java | 4 ++-- .../model/ArrayOfArrayOfNumberOnly.java | 4 ++-- .../io/swagger/model/ArrayOfNumberOnly.java | 4 ++-- .../gen/java/io/swagger/model/ArrayTest.java | 4 ++-- .../java/io/swagger/model/Capitalization.java | 4 ++-- .../src/gen/java/io/swagger/model/Cat.java | 4 ++-- .../gen/java/io/swagger/model/Category.java | 4 ++-- .../gen/java/io/swagger/model/ClassModel.java | 4 ++-- .../src/gen/java/io/swagger/model/Client.java | 4 ++-- .../src/gen/java/io/swagger/model/Dog.java | 4 ++-- .../gen/java/io/swagger/model/EnumArrays.java | 4 ++-- .../gen/java/io/swagger/model/EnumTest.java | 4 ++-- .../gen/java/io/swagger/model/FormatTest.java | 4 ++-- .../io/swagger/model/HasOnlyReadOnly.java | 4 ++-- .../gen/java/io/swagger/model/MapTest.java | 4 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 4 ++-- .../io/swagger/model/Model200Response.java | 4 ++-- .../io/swagger/model/ModelApiResponse.java | 4 ++-- .../java/io/swagger/model/ModelReturn.java | 4 ++-- .../src/gen/java/io/swagger/model/Name.java | 4 ++-- .../gen/java/io/swagger/model/NumberOnly.java | 4 ++-- .../src/gen/java/io/swagger/model/Order.java | 4 ++-- .../src/gen/java/io/swagger/model/Pet.java | 4 ++-- .../java/io/swagger/model/ReadOnlyFirst.java | 4 ++-- .../io/swagger/model/SpecialModelName.java | 4 ++-- .../src/gen/java/io/swagger/model/Tag.java | 4 ++-- .../src/gen/java/io/swagger/model/User.java | 4 ++-- .../server/petstore/jaxrs-spec/swagger.json | 22 +++++++++---------- 30 files changed, 69 insertions(+), 69 deletions(-) diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index e30da46f35a..083c8f8367e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class AdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -81,7 +81,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java index 64d5951369d..8650d14e8bc 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -81,7 +81,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java index b7fe2f4cc88..200775f0167 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -15,7 +15,7 @@ public class AnimalFarm extends ArrayList { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -44,7 +44,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index eca82ce2346..0bd229b83e9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -32,7 +32,7 @@ public class ArrayOfArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,7 +62,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 0781aaa524f..1efb2d90df2 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -32,7 +32,7 @@ public class ArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,7 +62,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java index ec005634cc3..b49ad740fc5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -66,7 +66,7 @@ public class ArrayTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -100,7 +100,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java index 1259f458e33..a500fed35d7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java @@ -115,7 +115,7 @@ public class Capitalization { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -155,7 +155,7 @@ public class Capitalization { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index 45f8e305503..369e4e84ed4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -30,7 +30,7 @@ public class Cat extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java index 08ce4b59b3a..a3a2cc5be04 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java @@ -46,7 +46,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java index b185dec45cb..f2396de59f5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -63,7 +63,7 @@ public class ClassModel { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java index 7680ebe1b58..49c7ed5e3a5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -29,7 +29,7 @@ public class Client { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -59,7 +59,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java index e48f4c000ef..aa9e82bcf5f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -30,7 +30,7 @@ public class Dog extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index 7aca1496efe..cf28b24b49c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -110,7 +110,7 @@ public enum ArrayEnumEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -142,7 +142,7 @@ public enum ArrayEnumEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index bb602ad3b73..a6acba24418 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -174,7 +174,7 @@ public enum EnumNumberEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public enum EnumNumberEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index b11fec88aab..e76e3b60134 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -262,7 +262,7 @@ public class FormatTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -316,7 +316,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index f0bb80cdeb8..8d8ceadc630 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -46,7 +46,7 @@ public class HasOnlyReadOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 39e105546fe..2f476ef0b11 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -80,7 +80,7 @@ public enum InnerEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -112,7 +112,7 @@ public enum InnerEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6c4654ce3a5..713aa31a066 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,7 +68,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -102,7 +102,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java index 2278ea9212d..95705f23a52 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -50,7 +50,7 @@ public class Model200Response { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -82,7 +82,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java index 9e570802581..df776f7a4fe 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -63,7 +63,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -97,7 +97,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java index 9c348ada11a..e0e35d3eec6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -33,7 +33,7 @@ public class ModelReturn { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -63,7 +63,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java index dbf1620a75a..01448e9d94b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -85,7 +85,7 @@ public class Name { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -121,7 +121,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java index cfd26e8bbc1..aa5f557859a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -30,7 +30,7 @@ public class NumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index c9af9b68a99..0bff53a3e85 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -146,7 +146,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -186,7 +186,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index dafcad72d14..bd6671115ca 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -152,7 +152,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -192,7 +192,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java index cfdba394a3e..a38b33097f8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -46,7 +46,7 @@ public class ReadOnlyFirst { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java index 9b80b631cc7..ec901836d3d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -29,7 +29,7 @@ public class SpecialModelName { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -59,7 +59,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java index 1debd2a7ecb..a007d782c1c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java @@ -46,7 +46,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java index 4b2896fa862..385cad6d8e8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java @@ -149,7 +149,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -193,7 +193,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 24eecd9e3ae..69d2c820988 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -375,8 +375,8 @@ "description" : "ID of pet that needs to be fetched", "required" : true, "type" : "integer", - "maximum" : 5.0, - "minimum" : 1.0, + "maximum" : 5, + "minimum" : 1, "format" : "int64" } ], "responses" : { @@ -736,16 +736,16 @@ "description" : "None", "required" : false, "type" : "integer", - "maximum" : 100.0, - "minimum" : 10.0 + "maximum" : 100, + "minimum" : 10 }, { "name" : "int32", "in" : "formData", "description" : "None", "required" : false, "type" : "integer", - "maximum" : 200.0, - "minimum" : 20.0, + "maximum" : 200, + "minimum" : 20, "format" : "int32" }, { "name" : "int64", @@ -877,6 +877,11 @@ } }, "securityDefinitions" : { + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + }, "petstore_auth" : { "type" : "oauth2", "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -888,11 +893,6 @@ }, "http_basic_test" : { "type" : "basic" - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" } }, "definitions" : { From 655ba95b94dae91d3ba44c9f4336be5b7985d77c Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 10:04:39 -0500 Subject: [PATCH 030/132] rebuilt --- .../java/io/swagger/handler/StringUtil.java | 2 +- .../model/AdditionalPropertiesClass.java | 6 +- .../src/gen/java/io/swagger/model/Animal.java | 8 +- .../gen/java/io/swagger/model/AnimalFarm.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 6 +- .../io/swagger/model/ArrayOfNumberOnly.java | 6 +- .../gen/java/io/swagger/model/ArrayTest.java | 6 +- .../java/io/swagger/model/Capitalization.java | 185 +++++++ .../src/gen/java/io/swagger/model/Cat.java | 6 +- .../gen/java/io/swagger/model/Category.java | 6 +- .../gen/java/io/swagger/model/ClassModel.java | 77 +++ .../src/gen/java/io/swagger/model/Client.java | 6 +- .../src/gen/java/io/swagger/model/Dog.java | 6 +- .../gen/java/io/swagger/model/EnumArrays.java | 6 +- .../gen/java/io/swagger/model/EnumTest.java | 33 +- .../gen/java/io/swagger/model/FormatTest.java | 23 +- .../io/swagger/model/HasOnlyReadOnly.java | 6 +- .../gen/java/io/swagger/model/MapTest.java | 6 +- ...ropertiesAndAdditionalPropertiesClass.java | 15 +- .../io/swagger/model/Model200Response.java | 24 +- .../io/swagger/model/ModelApiResponse.java | 6 +- .../java/io/swagger/model/ModelReturn.java | 6 +- .../src/gen/java/io/swagger/model/Name.java | 6 +- .../gen/java/io/swagger/model/NumberOnly.java | 6 +- .../src/gen/java/io/swagger/model/Order.java | 6 +- .../gen/java/io/swagger/model/OuterEnum.java | 44 ++ .../src/gen/java/io/swagger/model/Pet.java | 6 +- .../java/io/swagger/model/ReadOnlyFirst.java | 6 +- .../io/swagger/model/SpecialModelName.java | 6 +- .../src/gen/java/io/swagger/model/Tag.java | 6 +- .../src/gen/java/io/swagger/model/User.java | 6 +- .../io/swagger/handler/FakeController.java | 8 +- .../io/swagger/handler/PetController.java | 4 +- .../io/swagger/handler/StoreController.java | 2 +- .../io/swagger/handler/UserController.java | 4 +- .../src/main/swagger/swagger.yaml | 491 ++++++++++-------- 36 files changed, 716 insertions(+), 336 deletions(-) create mode 100644 samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/OuterEnum.java diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java index 337a801a13d..8c4ea039025 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.handler; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 9755503f600..8c599952625 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class AdditionalPropertiesClass { @JsonProperty("map_property") private Map mapProperty = new HashMap(); @@ -57,7 +57,7 @@ public class AdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java index 87ebd2daa69..7cd162494b5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java @@ -3,6 +3,8 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -10,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Animal { @JsonProperty("className") private String className = null; @@ -54,7 +56,7 @@ public class Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +88,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java index dfe4c29628d..64efc6c1a59 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java @@ -9,11 +9,11 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class AnimalFarm extends ArrayList { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -42,7 +42,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 37b5df65826..8a11e739803 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -37,7 +37,7 @@ public class ArrayOfArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 706d077179c..8ec9bb99a9b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -37,7 +37,7 @@ public class ArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java index 423f536df40..35f3b87c9c6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ArrayTest { @JsonProperty("array_of_string") private List arrayOfString = new ArrayList(); @@ -77,7 +77,7 @@ public class ArrayTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -111,7 +111,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..a2ce09c86c3 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java @@ -0,0 +1,185 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") +public class Capitalization { + @JsonProperty("smallCamel") + private String smallCamel = null; + + @JsonProperty("CapitalCamel") + private String capitalCamel = null; + + @JsonProperty("small_Snake") + private String smallSnake = null; + + @JsonProperty("Capital_Snake") + private String capitalSnake = null; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints = null; + + @JsonProperty("ATT_NAME") + private String ATT_NAME = null; + + /** + **/ + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("smallCamel") + public String getSmallCamel() { + return smallCamel; + } + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + /** + **/ + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("CapitalCamel") + public String getCapitalCamel() { + return capitalCamel; + } + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + /** + **/ + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("small_Snake") + public String getSmallSnake() { + return smallSnake; + } + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + /** + **/ + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("Capital_Snake") + public String getCapitalSnake() { + return capitalSnake; + } + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + /** + **/ + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + /** + * Name of the pet + **/ + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + @ApiModelProperty(example = "null", value = "Name of the pet ") + @JsonProperty("ATT_NAME") + public String getATTNAME() { + return ATT_NAME; + } + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(smallCamel, capitalization.smallCamel) && + Objects.equals(capitalCamel, capitalization.capitalCamel) && + Objects.equals(smallSnake, capitalization.smallSnake) && + Objects.equals(capitalSnake, capitalization.capitalSnake) && + Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java index 865008e47c8..7de3dcd9ad2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; @@ -35,7 +35,7 @@ public class Cat extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java index ff244e9e5ae..2fdba5564d2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Category { @JsonProperty("id") private Long id = null; @@ -54,7 +54,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..23a97020e73 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,77 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + +/** + * Model for testing model with \"_class\" property + **/ + +@ApiModel(description = "Model for testing model with \"_class\" property") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") +public class ClassModel { + @JsonProperty("_class") + private String propertyClass = null; + + /** + **/ + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("_class") + public String getPropertyClass() { + return propertyClass; + } + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java index 0f4b7b6bd0b..a6f919e84af 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Client { @JsonProperty("client") private String client = null; @@ -34,7 +34,7 @@ public class Client { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java index ddc5b138ec5..cb3bcf29d07 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Dog extends Animal { @JsonProperty("breed") private String breed = null; @@ -35,7 +35,7 @@ public class Dog extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java index 1e0dc66db47..ea7e8988c9a 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class EnumArrays { /** * Gets or Sets justSymbol @@ -119,7 +119,7 @@ public class EnumArrays { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -151,7 +151,7 @@ public class EnumArrays { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java index 9a0c2fb6107..eefd3b80736 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java @@ -6,12 +6,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.OuterEnum; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class EnumTest { /** * Gets or Sets enumString @@ -117,6 +118,9 @@ public class EnumTest { @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; + @JsonProperty("outerEnum") + private OuterEnum outerEnum = null; + /** **/ public EnumTest enumString(EnumStringEnum enumString) { @@ -168,9 +172,26 @@ public class EnumTest { this.enumNumber = enumNumber; } + /** + **/ + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("outerEnum") + public OuterEnum getOuterEnum() { + return outerEnum; + } + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -180,12 +201,13 @@ public class EnumTest { EnumTest enumTest = (EnumTest) o; return Objects.equals(enumString, enumTest.enumString) && Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber); + Objects.equals(enumNumber, enumTest.enumNumber) && + Objects.equals(outerEnum, enumTest.outerEnum); } @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber); + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } @Override @@ -196,6 +218,7 @@ public class EnumTest { sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,7 +227,7 @@ public class EnumTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java index 7535534538c..3e665dce6aa 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java @@ -7,12 +7,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; +import java.util.UUID; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class FormatTest { @JsonProperty("integer") private Integer integer = null; @@ -48,14 +49,14 @@ public class FormatTest { private Date dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; /** - * minimum: 10.0 - * maximum: 100.0 + * minimum: 10 + * maximum: 100 **/ public FormatTest integer(Integer integer) { this.integer = integer; @@ -73,8 +74,8 @@ public class FormatTest { } /** - * minimum: 20.0 - * maximum: 200.0 + * minimum: 20 + * maximum: 200 **/ public FormatTest int32(Integer int32) { this.int32 = int32; @@ -252,7 +253,7 @@ public class FormatTest { /** **/ - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -260,10 +261,10 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") @JsonProperty("uuid") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -286,7 +287,7 @@ public class FormatTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -340,7 +341,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 990188118de..2bde6e6d8b2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; @@ -54,7 +54,7 @@ public class HasOnlyReadOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java index e3e1a7b8753..c2c019a2ecb 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java @@ -14,7 +14,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class MapTest { @JsonProperty("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -89,7 +89,7 @@ public class MapTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -121,7 +121,7 @@ public class MapTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index ab28e910981..d17e620d6d7 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,15 +10,16 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private Date dateTime = null; @@ -28,7 +29,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** **/ - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -36,10 +37,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(example = "null", value = "") @JsonProperty("uuid") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -79,7 +80,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -113,7 +114,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java index b669912e402..73eaa26e4f0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java @@ -13,13 +13,13 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Model200Response { @JsonProperty("name") private Integer name = null; @JsonProperty("class") - private String PropertyClass = null; + private String propertyClass = null; /** **/ @@ -40,8 +40,8 @@ public class Model200Response { /** **/ - public Model200Response PropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -49,15 +49,15 @@ public class Model200Response { @ApiModelProperty(example = "null", value = "") @JsonProperty("class") public String getPropertyClass() { - return PropertyClass; + return propertyClass; } - public void setPropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -66,12 +66,12 @@ public class Model200Response { } Model200Response _200Response = (Model200Response) o; return Objects.equals(name, _200Response.name) && - Objects.equals(PropertyClass, _200Response.PropertyClass); + Objects.equals(propertyClass, _200Response.propertyClass); } @Override public int hashCode() { - return Objects.hash(name, PropertyClass); + return Objects.hash(name, propertyClass); } @Override @@ -80,7 +80,7 @@ public class Model200Response { sb.append("class Model200Response {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append("}"); return sb.toString(); } @@ -89,7 +89,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java index d2cf14c4833..bc04c42b61d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ModelApiResponse { @JsonProperty("code") private Integer code = null; @@ -74,7 +74,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -108,7 +108,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java index b240e33ad2f..a1790849286 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ModelReturn { @JsonProperty("return") private Integer _return = null; @@ -37,7 +37,7 @@ public class ModelReturn { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java index 2c1e02dbf3e..981b0e64500 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Name { @JsonProperty("name") private Integer name = null; @@ -97,7 +97,7 @@ public class Name { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -133,7 +133,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java index 33566fcb99c..3f5b4c78f30 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; @@ -35,7 +35,7 @@ public class NumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java index 55d84c48fff..6afd5c46781 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java @@ -12,7 +12,7 @@ import java.util.Date; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Order { @JsonProperty("id") private Long id = null; @@ -170,7 +170,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..8b7e863f8fb --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,44 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; + + + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java index c1b1942400b..e61d1eb24a2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java @@ -15,7 +15,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Pet { @JsonProperty("id") private Long id = null; @@ -173,7 +173,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -213,7 +213,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 8dc882acafc..49009d155f2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; @@ -54,7 +54,7 @@ public class ReadOnlyFirst { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java index 5503a673041..e87f684fb61 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; @@ -34,7 +34,7 @@ public class SpecialModelName { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java index 26fa90e969e..9fc0ec04bb9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class Tag { @JsonProperty("id") private Long id = null; @@ -54,7 +54,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java index f6e1584d8b0..50df8da5b29 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class User { @JsonProperty("id") private Long id = null; @@ -175,7 +175,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -219,7 +219,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java index 752414ff9ce..6b54c63ffee 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java @@ -10,11 +10,11 @@ import java.util.List; import io.swagger.model.*; +import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -import java.math.BigDecimal; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class FakeController { /** * Uncomment and implement as you see fit. These operations will map @@ -29,13 +29,13 @@ public class FakeController { */ /* - public ResponseContext testEndpointParameters(RequestContext request , BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) { + public ResponseContext testEndpointParameters(RequestContext request , BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testEnumParameters(RequestContext request , List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) { + public ResponseContext testEnumParameters(RequestContext request , List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java index d1bf6b1b589..d7e6e86c6c5 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java @@ -10,11 +10,11 @@ import java.util.List; import io.swagger.model.*; -import io.swagger.model.Pet; import java.io.File; import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class PetController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java index ee1a74508f0..d6f549bfd09 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java @@ -13,7 +13,7 @@ import io.swagger.model.*; import java.util.Map; import io.swagger.model.Order; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class StoreController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java index a5ff27d10ba..db705fe949c 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java @@ -10,10 +10,10 @@ import java.util.List; import io.swagger.model.*; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-08-20T17:24:26.037+08:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") public class UserController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml index cef4a8e8100..35f5130d3fd 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -30,221 +30,6 @@ tags: schemes: - "http" paths: - /fake: - get: - tags: - - "fake" - summary: "To test enum parameters" - operationId: "testEnumParameters" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - name: "enum_form_string_array" - in: "formData" - description: "Form parameter enum test (string array)" - required: false - type: "array" - - name: "enum_form_string" - in: "formData" - description: "Form parameter enum test (string)" - required: false - type: "string" - default: "-efg" - enum: - - "_abc" - - "-efg" - - "(xyz)" - - name: "enum_header_string_array" - in: "header" - description: "Header parameter enum test (string array)" - required: false - type: "array" - - name: "enum_header_string" - in: "header" - description: "Header parameter enum test (string)" - required: false - type: "string" - default: "-efg" - enum: - - "_abc" - - "-efg" - - "(xyz)" - - name: "enum_query_string_array" - in: "query" - description: "Query parameter enum test (string array)" - required: false - type: "array" - items: - type: "string" - default: "$" - enum: - - ">" - - "$" - - name: "enum_query_string" - in: "query" - description: "Query parameter enum test (string)" - required: false - type: "string" - default: "-efg" - enum: - - "_abc" - - "-efg" - - "(xyz)" - - name: "enum_query_integer" - in: "query" - description: "Query parameter enum test (double)" - required: false - type: "number" - format: "int32" - enum: - - null - - null - - name: "enum_query_double" - in: "formData" - description: "Query parameter enum test (double)" - required: false - type: "number" - format: "double" - enum: - - null - - null - responses: - 400: - description: "Invalid request" - 404: - description: "Not found" - x-contentType: "application/json" - x-accepts: "application/json" - post: - tags: - - "fake" - summary: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔\ - 드 포인트\n" - description: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n\ - 가짜 엔드 포인트\n" - operationId: "testEndpointParameters" - consumes: - - "application/xml; charset=utf-8" - - "application/json; charset=utf-8" - produces: - - "application/xml; charset=utf-8" - - "application/json; charset=utf-8" - parameters: - - name: "integer" - in: "formData" - description: "None" - required: false - type: "integer" - maximum: 100.0 - minimum: 10.0 - - name: "int32" - in: "formData" - description: "None" - required: false - type: "integer" - maximum: 200.0 - minimum: 20.0 - format: "int32" - - name: "int64" - in: "formData" - description: "None" - required: false - type: "integer" - format: "int64" - - name: "number" - in: "formData" - description: "None" - required: true - type: "number" - maximum: 543.2 - minimum: 32.1 - - name: "float" - in: "formData" - description: "None" - required: false - type: "number" - maximum: 987.6 - format: "float" - - name: "double" - in: "formData" - description: "None" - required: true - type: "number" - maximum: 123.4 - minimum: 67.8 - format: "double" - - name: "string" - in: "formData" - description: "None" - required: true - type: "string" - pattern: "/[a-z]/i" - - name: "byte" - in: "formData" - description: "None" - required: true - type: "string" - format: "byte" - - name: "binary" - in: "formData" - description: "None" - required: false - type: "string" - format: "binary" - - name: "date" - in: "formData" - description: "None" - required: false - type: "string" - format: "date" - - name: "dateTime" - in: "formData" - description: "None" - required: false - type: "string" - format: "date-time" - - name: "password" - in: "formData" - description: "None" - required: false - type: "string" - maxLength: 64 - minLength: 10 - format: "password" - responses: - 400: - description: "Invalid username supplied" - 404: - description: "User not found" - security: - - http_basic_test: [] - x-contentType: "application/xml; charset=utf-8" - x-accepts: "application/xml; charset=utf-8,application/json; charset=utf-8" - patch: - tags: - - "fake" - summary: "To test \"client\" model" - operationId: "testClientModel" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - in: "body" - name: "body" - description: "client model" - required: true - schema: - $ref: "#/definitions/Client" - responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/Client" - x-contentType: "application/json" - x-accepts: "application/json" /pet: post: tags: @@ -580,8 +365,8 @@ paths: description: "ID of pet that needs to be fetched" required: true type: "integer" - maximum: 5.0 - minimum: 1.0 + maximum: 5 + minimum: 1 format: "int64" responses: 200: @@ -610,7 +395,6 @@ paths: description: "ID of the order that needs to be deleted" required: true type: "string" - minimum: 1.0 responses: 400: description: "Invalid ID supplied" @@ -820,6 +604,240 @@ paths: description: "User not found" x-contentType: "application/json" x-accepts: "application/json" + /fake: + get: + tags: + - "fake" + summary: "To test enum parameters" + description: "To test enum parameters" + operationId: "testEnumParameters" + consumes: + - "*/*" + produces: + - "*/*" + parameters: + - name: "enum_form_string_array" + in: "formData" + description: "Form parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + - name: "enum_form_string" + in: "formData" + description: "Form parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_header_string_array" + in: "header" + description: "Header parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + - name: "enum_header_string" + in: "header" + description: "Header parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_query_string_array" + in: "query" + description: "Query parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + - name: "enum_query_string" + in: "query" + description: "Query parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_query_integer" + in: "query" + description: "Query parameter enum test (double)" + required: false + type: "integer" + format: "int32" + - name: "enum_query_double" + in: "formData" + description: "Query parameter enum test (double)" + required: false + type: "number" + format: "double" + responses: + 400: + description: "Invalid request" + 404: + description: "Not found" + x-contentType: "*/*" + x-accepts: "*/*" + post: + tags: + - "fake" + summary: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔\ + 드 포인트\n" + description: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n\ + 가짜 엔드 포인트\n" + operationId: "testEndpointParameters" + consumes: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + produces: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + parameters: + - name: "integer" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 100 + minimum: 10 + - name: "int32" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 200 + minimum: 20 + format: "int32" + - name: "int64" + in: "formData" + description: "None" + required: false + type: "integer" + format: "int64" + - name: "number" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 543.2 + minimum: 32.1 + - name: "float" + in: "formData" + description: "None" + required: false + type: "number" + maximum: 987.6 + format: "float" + - name: "double" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 123.4 + minimum: 67.8 + format: "double" + - name: "string" + in: "formData" + description: "None" + required: false + type: "string" + pattern: "/[a-z]/i" + - name: "pattern_without_delimiter" + in: "formData" + description: "None" + required: true + type: "string" + pattern: "^[A-Z].*" + - name: "byte" + in: "formData" + description: "None" + required: true + type: "string" + format: "byte" + - name: "binary" + in: "formData" + description: "None" + required: false + type: "string" + format: "binary" + - name: "date" + in: "formData" + description: "None" + required: false + type: "string" + format: "date" + - name: "dateTime" + in: "formData" + description: "None" + required: false + type: "string" + format: "date-time" + - name: "password" + in: "formData" + description: "None" + required: false + type: "string" + maxLength: 64 + minLength: 10 + format: "password" + - name: "callback" + in: "formData" + description: "None" + required: false + type: "string" + responses: + 400: + description: "Invalid username supplied" + 404: + description: "User not found" + security: + - http_basic_test: [] + x-contentType: "application/xml; charset=utf-8" + x-accepts: "application/xml; charset=utf-8,application/json; charset=utf-8" + patch: + tags: + - "fake" + summary: "To test \"client\" model" + description: "To test \"client\" model" + operationId: "testClientModel" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + x-contentType: "application/json" + x-accepts: "application/json" securityDefinitions: api_key: type: "apiKey" @@ -999,6 +1017,11 @@ definitions: description: "Model for testing model name starting with number" xml: name: "Name" + ClassModel: + properties: + _class: + type: "string" + description: "Model for testing model with \"_class\" property" Dog: allOf: - $ref: "#/definitions/Animal" @@ -1038,13 +1061,13 @@ definitions: properties: integer: type: "integer" - minimum: 10.0 - maximum: 100.0 + minimum: 10 + maximum: 100 int32: type: "integer" format: "int32" - minimum: 20.0 - maximum: 200.0 + minimum: 20 + maximum: 200 int64: type: "integer" format: "int64" @@ -1113,6 +1136,8 @@ definitions: enum: - 1.1 - -1.2 + outerEnum: + $ref: "#/definitions/OuterEnum" AdditionalPropertiesClass: type: "object" properties: @@ -1166,6 +1191,22 @@ definitions: foo: type: "string" readOnly: true + Capitalization: + type: "object" + properties: + smallCamel: + type: "string" + CapitalCamel: + type: "string" + small_Snake: + type: "string" + Capital_Snake: + type: "string" + SCA_ETH_Flow_Points: + type: "string" + ATT_NAME: + type: "string" + description: "Name of the pet\n" MapTest: type: "object" properties: @@ -1238,6 +1279,12 @@ definitions: enum: - "fish" - "crab" + OuterEnum: + type: "string" + enum: + - "placed" + - "approved" + - "delivered" externalDocs: description: "Find out more about Swagger" url: "http://swagger.io" From d9fb6f884633cd9294ea6a8945a7a137874c7ac1 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 10:58:33 -0500 Subject: [PATCH 031/132] trigger a build --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bb27e158b3b..ee032c0b3d9 100644 --- a/README.md +++ b/README.md @@ -1076,3 +1076,4 @@ limitations under the License. --- + From f15267c717f56803c518c118270c85c0ab473252 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 2 Mar 2017 01:56:27 +0800 Subject: [PATCH 032/132] add missing dependency to jaxrs pom --- .../src/main/resources/JavaJaxRS/pom.mustache | 8 +++++++- samples/server/petstore/jaxrs/jersey2/pom.xml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index 5338a135256..1739ddd5cc1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -133,7 +133,12 @@ jersey-media-multipart ${jersey2-version} - + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + com.brsanthu migbase64 @@ -181,6 +186,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 + 2.8.7 {{#supportJava6}} 2.5 3.5 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 989fa6f95d5..bf8b2a889df 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -133,7 +133,12 @@ jersey-media-multipart ${jersey2-version} - + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + com.brsanthu migbase64 @@ -166,6 +171,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 + 2.8.7 4.12 1.1.7 2.5 From 9e40700478a1da3c4df6ef713cca6cf9259e7774 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 2 Mar 2017 02:16:13 +0800 Subject: [PATCH 033/132] update jackson dependency and fix closing xml tag in jaxrs pom --- .../src/main/resources/JavaJaxRS/pom.mustache | 11 ++- samples/server/petstore/jaxrs/jersey2/pom.xml | 11 ++- .../petstore/springboot-delegate/pom.xml | 73 ------------------- 3 files changed, 16 insertions(+), 79 deletions(-) delete mode 100644 samples/server/petstore/springboot-delegate/pom.xml diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index 1739ddd5cc1..a28823d5858 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -134,8 +134,13 @@ ${jersey2-version} - com.fasterxml.jackson.core - jackson-core + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider ${jackson-version} @@ -186,7 +191,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 - 2.8.7 + 2.8.7 {{#supportJava6}} 2.5 3.5 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index bf8b2a889df..39125b0a9b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -134,8 +134,13 @@ ${jersey2-version} - com.fasterxml.jackson.core - jackson-core + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider ${jackson-version} @@ -171,7 +176,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 - 2.8.7 + 2.8.7 4.12 1.1.7 2.5 diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml deleted file mode 100644 index d777f7d31f1..00000000000 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 4.0.0 - io.swagger - swagger-spring - jar - swagger-spring - 1.0.0 - - 1.7 - ${java.version} - ${java.version} - 2.5.0 - - - org.springframework.boot - spring-boot-starter-parent - 1.3.5.RELEASE - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - - - joda-time - joda-time - - - - javax.validation - validation-api - 1.1.0.Final - provided - - - \ No newline at end of file From a27a76adf4590f412323c48192a722cd57749557 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 13:21:14 -0500 Subject: [PATCH 034/132] fixed missing dep --- .../src/main/resources/JavaJaxRS/pom.mustache | 11 ++++++++--- samples/server/petstore/jaxrs/jersey2/pom.xml | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index 1739ddd5cc1..a28823d5858 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -134,8 +134,13 @@ ${jersey2-version} - com.fasterxml.jackson.core - jackson-core + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider ${jackson-version} @@ -186,7 +191,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 - 2.8.7 + 2.8.7 {{#supportJava6}} 2.5 3.5 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index bf8b2a889df..39125b0a9b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -134,8 +134,13 @@ ${jersey2-version} - com.fasterxml.jackson.core - jackson-core + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider ${jackson-version} @@ -171,7 +176,7 @@ 1.5.12 9.2.9.v20150224 2.22.2 - 2.8.7 + 2.8.7 4.12 1.1.7 2.5 From b941fcfdb6e6dbb5dcae7f1d72fc406d87af9807 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 14:14:30 -0500 Subject: [PATCH 035/132] remove timestamp --- bin/java-inflector-petstore-server.sh | 2 +- .../main/resources/JavaInflector/generatedAnnotation.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/java-inflector-petstore-server.sh b/bin/java-inflector-petstore-server.sh index 701a2c3cf06..91e3481e7a1 100755 --- a/bin/java-inflector-petstore-server.sh +++ b/bin/java-inflector-petstore-server.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l inflector -o samples/server/petstore/java-inflector" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l inflector -o samples/server/petstore/java-inflector -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache index 49110fc1ad9..a47b6faa85b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") \ No newline at end of file +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file From b43b3771b1d79a613b66c2a9a71a60d029625a64 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 14:14:52 -0500 Subject: [PATCH 036/132] rebuilt --- .../src/gen/java/io/swagger/handler/StringUtil.java | 2 +- .../gen/java/io/swagger/model/AdditionalPropertiesClass.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Animal.java | 2 +- .../src/gen/java/io/swagger/model/AnimalFarm.java | 2 +- .../src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java | 2 +- .../src/gen/java/io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/ArrayTest.java | 2 +- .../src/gen/java/io/swagger/model/Capitalization.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Cat.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Category.java | 2 +- .../src/gen/java/io/swagger/model/ClassModel.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Client.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Dog.java | 2 +- .../src/gen/java/io/swagger/model/EnumArrays.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/EnumTest.java | 2 +- .../src/gen/java/io/swagger/model/FormatTest.java | 2 +- .../src/gen/java/io/swagger/model/HasOnlyReadOnly.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/MapTest.java | 2 +- .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 2 +- .../src/gen/java/io/swagger/model/Model200Response.java | 2 +- .../src/gen/java/io/swagger/model/ModelApiResponse.java | 2 +- .../src/gen/java/io/swagger/model/ModelReturn.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Name.java | 2 +- .../src/gen/java/io/swagger/model/NumberOnly.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Order.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Pet.java | 2 +- .../src/gen/java/io/swagger/model/ReadOnlyFirst.java | 2 +- .../src/gen/java/io/swagger/model/SpecialModelName.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/Tag.java | 2 +- .../java-inflector/src/gen/java/io/swagger/model/User.java | 2 +- .../src/main/java/io/swagger/handler/FakeController.java | 2 +- .../src/main/java/io/swagger/handler/PetController.java | 2 +- .../src/main/java/io/swagger/handler/StoreController.java | 2 +- .../src/main/java/io/swagger/handler/UserController.java | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java index 8c4ea039025..0ef6feff4a4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.handler; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 8c599952625..563d23ec391 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class AdditionalPropertiesClass { @JsonProperty("map_property") private Map mapProperty = new HashMap(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java index 7cd162494b5..bc24162abc2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java @@ -12,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java index 64efc6c1a59..534b8facf3a 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java @@ -9,7 +9,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 8a11e739803..0e82df95072 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 8ec9bb99a9b..be57ae33732 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") private List arrayNumber = new ArrayList(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java index 35f3b87c9c6..87be883b64c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ArrayTest { @JsonProperty("array_of_string") private List arrayOfString = new ArrayList(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java index a2ce09c86c3..226ed62a8ac 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java index 7de3dcd9ad2..b206e39218b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java index 2fdba5564d2..0096db3a911 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java index 23a97020e73..ee42479a76d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java index a6f919e84af..2568074f04d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java index cb3bcf29d07..01561875eb0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java index ea7e8988c9a..97b831be5c6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java index eefd3b80736..5066eab2a81 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java @@ -12,7 +12,7 @@ import io.swagger.model.OuterEnum; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java index 3e665dce6aa..3a5246fd98b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,7 @@ import java.util.UUID; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 2bde6e6d8b2..700768ba462 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java index c2c019a2ecb..1019fbccce8 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java @@ -14,7 +14,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class MapTest { @JsonProperty("map_map_of_string") private Map> mapMapOfString = new HashMap>(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index d17e620d6d7..44b8d9cecaf 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -16,7 +16,7 @@ import java.util.UUID; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java index 73eaa26e4f0..acb51f518de 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java index bc04c42b61d..fbf0fc13b5f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java index a1790849286..d0eae739323 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java index 981b0e64500..414b97f7ed2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java index 3f5b4c78f30..3a4fca7f30e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java index 6afd5c46781..5b12392af94 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java @@ -12,7 +12,7 @@ import java.util.Date; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java index e61d1eb24a2..fec9b3039c9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java @@ -15,7 +15,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 49009d155f2..7d23f2cbba5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java index e87f684fb61..4a12244c657 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java index 9fc0ec04bb9..aac98021f9b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java index 50df8da5b29..bda8d4267c7 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java index 6b54c63ffee..3c339e8d641 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java @@ -14,7 +14,7 @@ import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class FakeController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java index d7e6e86c6c5..ac2b651ce5f 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java @@ -14,7 +14,7 @@ import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class PetController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java index d6f549bfd09..58711922a6d 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java @@ -13,7 +13,7 @@ import io.swagger.model.*; import java.util.Map; import io.swagger.model.Order; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class StoreController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java index db705fe949c..c269add7cdc 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java @@ -13,7 +13,7 @@ import io.swagger.model.*; import java.util.List; import io.swagger.model.User; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-01T10:03:07.895-05:00") + public class UserController { /** * Uncomment and implement as you see fit. These operations will map From 8504c12ce0ecddc2505e8e83e69b64019e39577f Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 1 Mar 2017 14:22:34 -0500 Subject: [PATCH 037/132] update to release versions --- README.md | 2 +- modules/swagger-codegen-cli/pom.xml | 2 +- modules/swagger-codegen-maven-plugin/pom.xml | 2 +- modules/swagger-codegen/pom.xml | 2 +- modules/swagger-generator/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ee032c0b3d9..34568cbfd1b 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 2.3.0 (upcoming minor release) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes -2.2.2 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release (without breaking changes) +2.2.2 | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) 2.2.1 (**current stable**) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 36482e0752b..fafea2435b2 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.2.2-SNAPSHOT + 2.2.2 ../.. 4.0.0 diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index 85ac4a99433..e2d1e5a547c 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -6,7 +6,7 @@ io.swagger swagger-codegen-project - 2.2.2-SNAPSHOT + 2.2.2 ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index 6288700712b..e49435fbf31 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.2.2-SNAPSHOT + 2.2.2 ../.. 4.0.0 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index fcfcd0c9dca..4afb1acd659 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.2.2-SNAPSHOT + 2.2.2 ../.. swagger-generator diff --git a/pom.xml b/pom.xml index 3ebea1af254..8bd66d976ca 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.2.2-SNAPSHOT + 2.2.2 https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git From 1029b692e5fcfc2600433a85613ba42e2646826d Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 2 Mar 2017 15:25:38 +0800 Subject: [PATCH 038/132] update url to 2.2.2 release --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 34568cbfd1b..b623dcc2757 100644 --- a/README.md +++ b/README.md @@ -67,18 +67,18 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 2.3.0 (upcoming minor release) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes -2.2.2 | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) -2.2.1 (**current stable**) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) +2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) +2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites -If you're looking for the latest stable version, you can grab it directly from maven central (you'll need java 7 runtime at a minimum): +If you're looking for the latest stable version, you can grab it directly from Sonatype.org (Java 7 runtime at a minimum): ``` -wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar -O swagger-codegen-cli.jar +wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` From 26257daec35094ebdbe01be049ce9eb0cd03ab7d Mon Sep 17 00:00:00 2001 From: baartosz Date: Thu, 2 Mar 2017 08:45:42 +0000 Subject: [PATCH 039/132] fixed ApiException's methods return types (#4845) --- .../src/main/resources/php/ApiException.mustache | 14 +++++++------- .../php/SwaggerClient-php/lib/ApiException.php | 14 +++++++------- .../php/SwaggerClient-php/lib/ApiException.php | 14 +++++++------- samples/client/petstore/php/test.php | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 3df0f467fc0..31dc76fe3fb 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -55,12 +55,12 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[] $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -70,7 +70,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[] HTTP response headers */ public function getResponseHeaders() { @@ -80,7 +80,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 4c029f982ae..6bc8c02024d 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -65,12 +65,12 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[] $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -80,7 +80,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[] HTTP response headers */ public function getResponseHeaders() { @@ -90,7 +90,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 8fa9056dbab..2c1a040490b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -65,12 +65,12 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[] $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -80,7 +80,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[] HTTP response headers */ public function getResponseHeaders() { @@ -90,7 +90,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/samples/client/petstore/php/test.php b/samples/client/petstore/php/test.php index 6f571a1c176..5c27e3d7ae9 100644 --- a/samples/client/petstore/php/test.php +++ b/samples/client/petstore/php/test.php @@ -55,7 +55,7 @@ try { } catch (Swagger\Client\ApiException $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; - echo 'HTTP response headers: ', $e->getResponseHeaders(), "\n"; - echo 'HTTP response body: ', $e->getResponseBody(), "\n"; + echo 'HTTP response headers: ', print_r($e->getResponseHeaders(), true), "\n"; + echo 'HTTP response body: ', print_r($e->getResponseBody(), true), "\n"; echo 'HTTP status code: ', $e->getCode(), "\n"; } From 775f108d4e5313931cd11b6d7dbbab4e6d6b22ea Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 2 Mar 2017 16:54:37 +0800 Subject: [PATCH 040/132] update version to 2.2.3-SNAPSHOT (#4894) --- modules/swagger-codegen-cli/pom.xml | 2 +- modules/swagger-codegen-maven-plugin/pom.xml | 2 +- modules/swagger-codegen/pom.xml | 2 +- modules/swagger-generator/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index fafea2435b2..e175b2c4585 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.2.2 + 2.2.3-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index e2d1e5a547c..994b6af88d2 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -6,7 +6,7 @@ io.swagger swagger-codegen-project - 2.2.2 + 2.2.3-SNAPSHOT ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index e49435fbf31..99c74490c3f 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.2.2 + 2.2.3-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 4afb1acd659..f7ee4de0ba7 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.2.2 + 2.2.3-SNAPSHOT ../.. swagger-generator diff --git a/pom.xml b/pom.xml index 8bd66d976ca..72aeb6df506 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.2.2 + 2.2.3-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git From 167b2f59b811ba6780976a6e6764c1edf75a30f7 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 2 Mar 2017 16:56:56 +0800 Subject: [PATCH 041/132] add 2.2.3 to the table --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b623dcc2757..660bdb7d549 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -2.3.0 (upcoming minor release) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes +2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes +2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes 2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) 2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) From 1b1767e48999a58d2cfbe438e69bb974078c8839 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 2 Mar 2017 10:48:30 +0100 Subject: [PATCH 042/132] [Bash] Bugfix default curl options fix (#4832) * Fixed default cURL parameter handling * Fixed iterator increments in JSON body Bash generator * Added tests for content type and default cURL params * Fixed generated Dockerfile Bash script access rights * Generated test sample client * Updated Bash generator README --- .../codegen/languages/BashClientCodegen.java | 3 +- .../main/resources/bash/Dockerfile.mustache | 2 +- .../src/main/resources/bash/README.md | 9 +-- .../src/main/resources/bash/client.mustache | 27 ++++---- samples/client/petstore/bash/Dockerfile | 61 +++++++++++++++++++ samples/client/petstore/bash/_petstore-cli | 2 +- samples/client/petstore/bash/petstore-cli | 31 +++++----- .../bash/petstore-cli.bash-completion | 2 +- .../petstore/bash/tests/petstore_test.sh | 22 +++++-- 9 files changed, 115 insertions(+), 44 deletions(-) create mode 100644 samples/client/petstore/bash/Dockerfile diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java index 49cd8352866..edd4f52bc71 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java @@ -194,11 +194,10 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public void processOpts() { super.processOpts(); - String curlopts = ""; if (additionalProperties.containsKey(CURL_OPTIONS)) { setCurlOptions(additionalProperties.get(CURL_OPTIONS).toString()); - additionalProperties.put("x-codegen-curl-options", curlopts); + additionalProperties.put("x-codegen-curl-options", this.curlOptions); } if (additionalProperties.containsKey(PROCESS_MARKDOWN)) { diff --git a/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache b/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache index 9af7d224f6f..b59e5a3665a 100644 --- a/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache @@ -6,7 +6,7 @@ RUN apt-get install -y bash-completion zsh curl cowsay git vim bsdmainutils ADD {{scriptName}} /usr/bin/{{scriptName}} ADD _{{scriptName}} /usr/local/share/zsh/site-functions/_{{scriptName}} ADD {{scriptName}}.bash-completion /etc/bash-completion.d/{{scriptName}} - +RUN chmod 755 /usr/bin/{{scriptName}} # # Install oh-my-zsh diff --git a/modules/swagger-codegen/src/main/resources/bash/README.md b/modules/swagger-codegen/src/main/resources/bash/README.md index da35f04ae67..88fd2dfbee6 100644 --- a/modules/swagger-codegen/src/main/resources/bash/README.md +++ b/modules/swagger-codegen/src/main/resources/bash/README.md @@ -28,7 +28,7 @@ $ git clone https://github.com/swagger-api/swagger-codegen Build the codegen: ```shell -$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies +$ mvn package ``` Define custom codegen properties in a Json file, e.g.: @@ -47,14 +47,15 @@ Define custom codegen properties in a Json file, e.g.: Generate the client: ```shell -$ java -cp target/bash-swagger-codegen-1.0.0.jar io.swagger.codegen.SwaggerCodegen generate -l bash -i http://petstore.swagger.io/v2/swagger.json -o output -c resources/example-config.json +$ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l bash -o generated/bash/petstore -c modules/swagger-codegen/src/test/resources/2_0/bash-config.json -$ chmod +x output/petstore-cli +$ chmod +x generated/bash/petstore/petstore-cli ``` Enjoy: ```shell -$ output/petstore-cli -h +$ cd generated/bash/petstore +$ ./petstore-cli -h Swagger Petstore command line client (API version 1.0.0) diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index e1e3aad1cfd..5c567de2cb1 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -292,7 +292,7 @@ body_parameters_to_json() { if [[ $count -lt $body_parameter_count-1 ]]; then body_json+=", " fi - count+=1 + ((count+=1)) done body_json+="}'" @@ -362,7 +362,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "multi" ]]; then local vcount=0 @@ -372,7 +372,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "csv" ]]; then path_template+="${qparam}=" @@ -383,7 +383,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="," fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "ssv" ]]; then path_template+="${qparam}=" @@ -393,7 +393,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+=" " fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "tsv" ]]; then path_template+="${qparam}=" @@ -403,7 +403,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="\t" fi - vcount+=1 + ((vcount+=1)) done else echo -e "" @@ -416,7 +416,7 @@ validate_request_parameters() { if [[ $count -lt $query_parameter_count-1 ]]; then path_template+="&" fi - count+=1 + ((count+=1)) done } @@ -484,7 +484,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... @@ -497,7 +497,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'csv' collections i.e. param=value1,value2,... @@ -511,7 +511,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="," fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." @@ -525,7 +525,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+=" " fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." @@ -539,7 +539,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="\t" fi - vcount+=1 + ((vcount+=1)) done fi @@ -551,8 +551,7 @@ build_request_path() { query_request_part+="&" fi - count+=1 - + ((count+=1)) done diff --git a/samples/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile new file mode 100644 index 00000000000..2d4a88cdfd0 --- /dev/null +++ b/samples/client/petstore/bash/Dockerfile @@ -0,0 +1,61 @@ +FROM ubuntu:16.10 + +RUN apt-get update -y && apt-get full-upgrade -y +RUN apt-get install -y bash-completion zsh curl cowsay git vim bsdmainutils + +ADD petstore-cli /usr/bin/petstore-cli +ADD _petstore-cli /usr/local/share/zsh/site-functions/_petstore-cli +ADD petstore-cli.bash-completion /etc/bash-completion.d/petstore-cli +RUN chmod 755 /usr/bin/petstore-cli + +# +# Install oh-my-zsh +# +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" || true + +# +# Enable bash completion +# +RUN echo '\n\ +. /etc/bash_completion\n\ +source /etc/bash-completion.d/petstore-cli\n\ +' >> ~/.bashrc + +# +# Setup prompt +# +RUN echo 'export PS1="[Swagger Petstore] \$ "' >> ~/.bashrc +RUN echo 'export PROMPT="[Swagger Petstore] \$ "' >> ~/.zshrc + +# +# Setup a welcome message with basic instruction +# +RUN echo 'cat << EOF\n\ +\n\ +This Docker provides preconfigured environment for running the command\n\ +line REST client for $(tput setaf 6)Swagger Petstore$(tput sgr0).\n\ +\n\ +For convenience, you can export the following environment variables:\n\ +\n\ +$(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com:8080\n\ +$(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ +$(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ +\n\ +$(tput setaf 7)Basic usage:$(tput sgr0)\n\ +\n\ +$(tput setaf 3)Print the list of operations available on the service$(tput sgr0)\n\ +$ petstore-cli -h\n\ +\n\ +$(tput setaf 3)Print the service description$(tput sgr0)\n\ +$ petstore-cli --about\n\ +\n\ +$(tput setaf 3)Print detailed information about specific operation$(tput sgr0)\n\ +$ petstore-cli -h\n\ +\n\ +By default you are logged into Zsh with full autocompletion for your REST API,\n\ +but you can switch to Bash, where basic autocompletion is also supported.\n\ +\n\ +EOF\n\ +' | tee -a ~/.bashrc ~/.zshrc + +ENTRYPOINT ["zsh"] diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index a1a2a44dcb9..83c205c60d4 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -10,7 +10,7 @@ # ! # ! Based on: https://github.com/Valodim/zsh-curl-completion/blob/master/_curl # ! -# ! Generated on: 2017-02-06T21:48:13.013+01:00 +# ! Generated on: 2017-02-22T08:48:10.130+01:00 # ! # ! # ! Installation: diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 6b3270270ce..d967af25bb6 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -8,7 +8,7 @@ # ! swagger-codegen (https://github.com/swagger-api/swagger-codegen) # ! FROM SWAGGER SPECIFICATION IN JSON. # ! -# ! Generated on: 2017-02-06T21:48:13.013+01:00 +# ! Generated on: 2017-02-22T08:48:10.130+01:00 # ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -234,7 +234,7 @@ declare -A body_parameters ## # These arguments will be directly passed to cURL -curl_arguments="" +curl_arguments="-sS --tlsv1.2" ## # The host for making the request @@ -387,7 +387,7 @@ body_parameters_to_json() { if [[ $count -lt $body_parameter_count-1 ]]; then body_json+=", " fi - count+=1 + ((count+=1)) done body_json+="}'" @@ -457,7 +457,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "multi" ]]; then local vcount=0 @@ -467,7 +467,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "csv" ]]; then path_template+="${qparam}=" @@ -478,7 +478,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="," fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "ssv" ]]; then path_template+="${qparam}=" @@ -488,7 +488,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+=" " fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "tsv" ]]; then path_template+="${qparam}=" @@ -498,7 +498,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="\t" fi - vcount+=1 + ((vcount+=1)) done else echo -e "" @@ -511,7 +511,7 @@ validate_request_parameters() { if [[ $count -lt $query_parameter_count-1 ]]; then path_template+="&" fi - count+=1 + ((count+=1)) done } @@ -579,7 +579,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... @@ -592,7 +592,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'csv' collections i.e. param=value1,value2,... @@ -606,7 +606,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="," fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." @@ -620,7 +620,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+=" " fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." @@ -634,7 +634,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="\t" fi - vcount+=1 + ((vcount+=1)) done fi @@ -646,8 +646,7 @@ build_request_path() { query_request_part+="&" fi - count+=1 - + ((count+=1)) done diff --git a/samples/client/petstore/bash/petstore-cli.bash-completion b/samples/client/petstore/bash/petstore-cli.bash-completion index f8b11cde5b2..58e1965d5c6 100644 --- a/samples/client/petstore/bash/petstore-cli.bash-completion +++ b/samples/client/petstore/bash/petstore-cli.bash-completion @@ -8,7 +8,7 @@ # ! swagger-codegen (https://github.com/swagger-api/swagger-codegen) # ! FROM SWAGGER SPECIFICATION IN JSON. # ! -# ! Generated on: 2017-02-06T21:48:13.013+01:00 +# ! Generated on: 2017-02-22T08:48:10.130+01:00 # ! # ! # ! System wide installation: diff --git a/samples/client/petstore/bash/tests/petstore_test.sh b/samples/client/petstore/bash/tests/petstore_test.sh index 139679eb3ee..eb9b2291a49 100644 --- a/samples/client/petstore/bash/tests/petstore_test.sh +++ b/samples/client/petstore/bash/tests/petstore_test.sh @@ -22,6 +22,18 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ "$output" =~ "Error: Request's content-type not specified!" ]] } +@test "addPet abbreviated content type" { + run bash $PETSTORE_CLI -ct json -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: application/json" ]] +} + +@test "addPet unabbreviated content type" { + run bash $PETSTORE_CLI -ct userdefined/custom -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: userdefined/custom" ]] +} + @test "fakeOperation invalid operation name" { run bash \ -c "bash $PETSTORE_CLI --host http://petstore.swagger.io fakeOperation" @@ -46,8 +58,11 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ ! "$output" =~ "-H \"api_key:" ]] } - - +@test "findPetsByStatus has default cURL parameters" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 --dry-run" + [[ ! "$output" =~ " -Ss " ]] +} @test "findPetsByStatus too few values" { run bash \ @@ -97,6 +112,3 @@ export PETSTORE_HOST="http://petstore.swagger.io" bash $PETSTORE_CLI -ct json -ac xml addPet -" [[ "$output" =~ "37567" ]] } - - - From 55b64fcbfd7c803996b4e6044b8287b4874ae56e Mon Sep 17 00:00:00 2001 From: Oliver Trosien Date: Thu, 2 Mar 2017 11:05:21 +0100 Subject: [PATCH 043/132] Remove maven-api dependencies on swagger-codegen module (#4840) * Remove maven-api dependencies * Use org.apache.commons.lang3.StringUtils --- modules/swagger-codegen/pom.xml | 10 ---------- .../swagger/codegen/examples/XmlExampleGenerator.java | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index 99c74490c3f..2802b90a1e8 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -224,16 +224,6 @@ commons-io ${commons-io-version} - - org.apache.maven - maven-plugin-tools-api - 2.0 - - - org.apache.felix - maven-bundle-plugin - ${felix-version} - org.slf4j slf4j-ext diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java index c59449be439..9ccba055dbc 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java @@ -20,7 +20,7 @@ import io.swagger.models.properties.Property; import io.swagger.models.properties.RefProperty; import io.swagger.models.properties.StringProperty; -import org.codehaus.plexus.util.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From 195ff25f439a6d40841fee880a85eb54c4d17981 Mon Sep 17 00:00:00 2001 From: Alexej Haak Date: Thu, 2 Mar 2017 17:16:10 +0100 Subject: [PATCH 044/132] fixes progress for file upload with alamofire / swift3 --- .../src/main/resources/swift3/AlamofireImplementations.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache index a332333a295..9ded8f13eb1 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): From 0dab200f286ffb8cb25d54ccdb474b1dc3b0ff03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Fri, 3 Mar 2017 09:34:07 +0100 Subject: [PATCH 045/132] Update spring samples with current code. (#4874) * Update spring samples with current code. This is done so I can see my own changes better. * Regenerate samples after 2.2.2. --- .../client/petstore/spring-cloud/README.md | 8 +- samples/client/petstore/spring-cloud/pom.xml | 8 +- samples/client/petstore/spring-stubs/pom.xml | 7 ++ .../src/main/java/io/swagger/api/PetApi.java | 6 +- .../main/java/io/swagger/api/StoreApi.java | 4 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../main/java/io/swagger/model/Category.java | 2 +- .../io/swagger/model/ModelApiResponse.java | 2 +- .../src/main/java/io/swagger/model/Order.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../src/main/java/io/swagger/model/Tag.java | 2 +- .../src/main/java/io/swagger/model/User.java | 2 +- .../petstore/springboot-delegate/pom.xml | 73 +++++++++++++++++++ 13 files changed, 104 insertions(+), 22 deletions(-) create mode 100644 samples/server/petstore/springboot-delegate/pom.xml diff --git a/samples/client/petstore/spring-cloud/README.md b/samples/client/petstore/spring-cloud/README.md index 56d8781caad..0d2d58540db 100644 --- a/samples/client/petstore/spring-cloud/README.md +++ b/samples/client/petstore/spring-cloud/README.md @@ -1,4 +1,4 @@ -# swagger-spring +# swagger-petstore-spring-cloud ## Requirements @@ -27,7 +27,7 @@ Add this dependency to your project's POM: ```xml io.swagger - swagger-spring + swagger-petstore-spring-cloud 1.0.0 compile @@ -38,7 +38,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-spring:1.0.0" +compile "io.swagger:swagger-petstore-spring-cloud:1.0.0" ``` ### Others @@ -49,5 +49,5 @@ mvn package Then manually install the following JARs: -* target/swagger-spring-1.0.0.jar +* target/swagger-petstore-spring-cloud-1.0.0.jar * target/lib/*.jar diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index 6bd8e898370..31299a7e810 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -1,15 +1,15 @@ 4.0.0 io.swagger - swagger-cloud + swagger-petstore-spring-cloud jar - swagger-cloud + swagger-petstore-spring-cloud 1.0.0 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 org.springframework.boot @@ -72,4 +72,4 @@ test - + \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/pom.xml b/samples/client/petstore/spring-stubs/pom.xml index 851d0f3018c..c9b23f86de9 100644 --- a/samples/client/petstore/spring-stubs/pom.xml +++ b/samples/client/petstore/spring-stubs/pom.xml @@ -49,5 +49,12 @@ joda-time joda-time + + + javax.validation + validation-api + 1.1.0.Final + provided + \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 735c9548bcc..2b6bb97460c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -65,7 +65,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -81,7 +81,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index 1eb724e96c9..de152b505c0 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "store", description = "the store API") public interface StoreApi { @@ -52,7 +52,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index e212a819908..28c184dabd1 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "user", description = "the user API") public interface UserApi { @@ -81,8 +81,8 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java index 3c8cf28ec23..9611305a687 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * A category for a pet */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java index 6d6641bfe9a..63561b90939 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Describes the result of uploading an image resource */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java index ee99fb04426..4c8c3eaddf6 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - +import javax.validation.constraints.*; /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java index 5cdfc19b38e..bab3ea4ec20 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java @@ -10,7 +10,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * A pet for sale in the pet store */ @@ -114,6 +114,7 @@ public class Pet { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull public String getName() { return name; } @@ -137,6 +138,7 @@ public class Pet { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java index 7fd1757b21c..f363f8d9f86 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * A tag for a pet */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java index f14694154b4..1766e5dde17 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * A User who is purchasing from the pet store */ diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml new file mode 100644 index 00000000000..d777f7d31f1 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + io.swagger + swagger-spring + jar + swagger-spring + 1.0.0 + + 1.7 + ${java.version} + ${java.version} + 2.5.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + + + joda-time + joda-time + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + \ No newline at end of file From 88c9b6062dff6d2e9a3d0298190290b7c8e5479f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Fri, 3 Mar 2017 09:35:12 +0100 Subject: [PATCH 046/132] Fix for #1219 (#4875) * Update spring samples with current code. This is done so I can see my own changes better. * Regenerate samples after 2.2.2. * use baseName instead of paramName for spring annotations. * update spring petstore samples to show the effects. --- .../resources/JavaSpring/formParams.mustache | 2 +- .../resources/JavaSpring/pathParams.mustache | 2 +- .../resources/JavaSpring/queryParams.mustache | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 22 +++++++++---------- .../src/main/java/io/swagger/api/FakeApi.java | 22 +++++++++---------- .../io/swagger/api/FakeApiController.java | 22 +++++++++---------- .../src/main/java/io/swagger/api/FakeApi.java | 22 +++++++++---------- .../io/swagger/api/FakeApiController.java | 22 +++++++++---------- .../src/main/java/io/swagger/api/FakeApi.java | 22 +++++++++---------- .../io/swagger/api/FakeApiController.java | 22 +++++++++---------- .../src/main/java/io/swagger/api/FakeApi.java | 22 +++++++++---------- .../io/swagger/api/FakeApiController.java | 22 +++++++++---------- 12 files changed, 102 insertions(+), 102 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache index 74c2d566d40..3bdb6f13743 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestPart(value="{{paramName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestPart(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache index aab5fd8ef42..d577abfb25a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{paramName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache index 792c265aacb..7db51c9b0d2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value = "{{paramName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 9590001aab3..b0bb957c8f2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -48,19 +48,19 @@ public interface FakeApi { consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -74,14 +74,14 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index 74fb7693d7a..26e37db340a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -43,19 +43,19 @@ public interface FakeApi { consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @@ -66,13 +66,13 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java index b1225a72bc5..9011ce8ef63 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java @@ -32,31 +32,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index cbdd93952b8..f6611a91a30 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -47,19 +47,19 @@ public interface FakeApi { consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -73,14 +73,14 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java index 6e162ee2183..4ed0677b103 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java @@ -37,31 +37,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index 74fb7693d7a..26e37db340a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -43,19 +43,19 @@ public interface FakeApi { consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @@ -66,13 +66,13 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java index b6b0b70ba51..5d9ae688c43 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java @@ -37,31 +37,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index 74fb7693d7a..26e37db340a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -43,19 +43,19 @@ public interface FakeApi { consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @@ -66,13 +66,13 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java index b1225a72bc5..9011ce8ef63 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java @@ -32,31 +32,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } From 6c63558acc9d5c109c54035dd6a7c561da85e910 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Mar 2017 16:45:43 +0800 Subject: [PATCH 047/132] better python flask readme (#4844) --- .../resources/flaskConnexion/README.mustache | 9 +++++++++ .../petstore/flaskConnexion-python2/README.md | 4 ++++ .../swagger_server/models/category.py | 8 ++++---- .../swagger_server/models/order.py | 16 ++++++++-------- .../swagger_server/models/pet.py | 8 ++++---- .../swagger_server/models/tag.py | 8 ++++---- .../swagger_server/models/user.py | 8 ++++---- .../swagger_server/swagger/swagger.yaml | 7 +++---- samples/server/petstore/flaskConnexion/README.md | 6 +++++- .../swagger_server/swagger/swagger.yaml | 7 +++---- 10 files changed, 48 insertions(+), 33 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache index f8471d67b95..e01093b6780 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache @@ -7,6 +7,15 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +{{#supportPython2}} +Python 2.7+ +{{/supportPython2}} +{{^supportPython2}} +Python 3.5.2+ +{{/supportPython2}} + +## Usage To run the server, please execute the following from the root directory: ``` diff --git a/samples/server/petstore/flaskConnexion-python2/README.md b/samples/server/petstore/flaskConnexion-python2/README.md index 5352812b279..7e38f10f770 100644 --- a/samples/server/petstore/flaskConnexion-python2/README.md +++ b/samples/server/petstore/flaskConnexion-python2/README.md @@ -7,6 +7,10 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +Python 2.7+ + +## Usage To run the server, please execute the following from the root directory: ``` diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py index 440b19f7a82..fd702edf6fe 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py @@ -17,12 +17,12 @@ class Category(Model): Category - a model defined in Swagger :param id: The id of this Category. - :type id: int + :type id: long :param name: The name of this Category. :type name: str """ self.swagger_types = { - 'id': int, + 'id': long, 'name': str } @@ -52,7 +52,7 @@ class Category(Model): Gets the id of this Category. :return: The id of this Category. - :rtype: int + :rtype: long """ return self._id @@ -62,7 +62,7 @@ class Category(Model): Sets the id of this Category. :param id: The id of this Category. - :type id: int + :type id: long """ self._id = id diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py index a3cb599defa..9574a16fb46 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py @@ -17,9 +17,9 @@ class Order(Model): Order - a model defined in Swagger :param id: The id of this Order. - :type id: int + :type id: long :param pet_id: The pet_id of this Order. - :type pet_id: int + :type pet_id: long :param quantity: The quantity of this Order. :type quantity: int :param ship_date: The ship_date of this Order. @@ -30,8 +30,8 @@ class Order(Model): :type complete: bool """ self.swagger_types = { - 'id': int, - 'pet_id': int, + 'id': long, + 'pet_id': long, 'quantity': int, 'ship_date': datetime, 'status': str, @@ -72,7 +72,7 @@ class Order(Model): Gets the id of this Order. :return: The id of this Order. - :rtype: int + :rtype: long """ return self._id @@ -82,7 +82,7 @@ class Order(Model): Sets the id of this Order. :param id: The id of this Order. - :type id: int + :type id: long """ self._id = id @@ -93,7 +93,7 @@ class Order(Model): Gets the pet_id of this Order. :return: The pet_id of this Order. - :rtype: int + :rtype: long """ return self._pet_id @@ -103,7 +103,7 @@ class Order(Model): Sets the pet_id of this Order. :param pet_id: The pet_id of this Order. - :type pet_id: int + :type pet_id: long """ self._pet_id = pet_id diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py index 074f5d2366c..0ecf301be64 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py @@ -19,7 +19,7 @@ class Pet(Model): Pet - a model defined in Swagger :param id: The id of this Pet. - :type id: int + :type id: long :param category: The category of this Pet. :type category: Category :param name: The name of this Pet. @@ -32,7 +32,7 @@ class Pet(Model): :type status: str """ self.swagger_types = { - 'id': int, + 'id': long, 'category': Category, 'name': str, 'photo_urls': List[str], @@ -74,7 +74,7 @@ class Pet(Model): Gets the id of this Pet. :return: The id of this Pet. - :rtype: int + :rtype: long """ return self._id @@ -84,7 +84,7 @@ class Pet(Model): Sets the id of this Pet. :param id: The id of this Pet. - :type id: int + :type id: long """ self._id = id diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py index 6ff4243a1a4..76b4c15c97e 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py @@ -17,12 +17,12 @@ class Tag(Model): Tag - a model defined in Swagger :param id: The id of this Tag. - :type id: int + :type id: long :param name: The name of this Tag. :type name: str """ self.swagger_types = { - 'id': int, + 'id': long, 'name': str } @@ -52,7 +52,7 @@ class Tag(Model): Gets the id of this Tag. :return: The id of this Tag. - :rtype: int + :rtype: long """ return self._id @@ -62,7 +62,7 @@ class Tag(Model): Sets the id of this Tag. :param id: The id of this Tag. - :type id: int + :type id: long """ self._id = id diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py index 715832d2f01..27f215ef61c 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py @@ -17,7 +17,7 @@ class User(Model): User - a model defined in Swagger :param id: The id of this User. - :type id: int + :type id: long :param username: The username of this User. :type username: str :param first_name: The first_name of this User. @@ -34,7 +34,7 @@ class User(Model): :type user_status: int """ self.swagger_types = { - 'id': int, + 'id': long, 'username': str, 'first_name': str, 'last_name': str, @@ -82,7 +82,7 @@ class User(Model): Gets the id of this User. :return: The id of this User. - :rtype: int + :rtype: long """ return self._id @@ -92,7 +92,7 @@ class User(Model): Sets the id of this User. :param id: The id of this User. - :type id: int + :type id: long """ self._id = id diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml index 9d948b2124f..a12fa87d872 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: @@ -356,8 +356,8 @@ paths: description: "ID of pet that needs to be fetched" required: true type: "integer" - maximum: 5.0 - minimum: 1.0 + maximum: 5 + minimum: 1 format: "int64" responses: 200: @@ -385,7 +385,6 @@ paths: description: "ID of the order that needs to be deleted" required: true type: "string" - minimum: 1.0 responses: 400: description: "Invalid ID supplied" diff --git a/samples/server/petstore/flaskConnexion/README.md b/samples/server/petstore/flaskConnexion/README.md index 91b687abcf4..9effb404b08 100644 --- a/samples/server/petstore/flaskConnexion/README.md +++ b/samples/server/petstore/flaskConnexion/README.md @@ -7,6 +7,10 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +Python 3.5.2+ + +## Usage To run the server, please execute the following from the root directory: ``` @@ -28,6 +32,6 @@ http://localhost:8080/v2/swagger.json To launch the integration tests, use tox: ``` -sudo pip install tox +sudo pip install tox tox ``` diff --git a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml index 9d948b2124f..a12fa87d872 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: @@ -356,8 +356,8 @@ paths: description: "ID of pet that needs to be fetched" required: true type: "integer" - maximum: 5.0 - minimum: 1.0 + maximum: 5 + minimum: 1 format: "int64" responses: 200: @@ -385,7 +385,6 @@ paths: description: "ID of the order that needs to be deleted" required: true type: "string" - minimum: 1.0 responses: 400: description: "Invalid ID supplied" From b894dc3827d9cb493e03060ff4d725fb6a9f3765 Mon Sep 17 00:00:00 2001 From: Hamed Ramezanian Nik Date: Fri, 3 Mar 2017 08:48:11 +0000 Subject: [PATCH 048/132] Encode form paramerers properly\n (#4836) Superagent doesn't encode form parameters properly. For example it doesn't encode objects which contain array. The following is a failed test case: var my_opts = { 'storyId': 65441, 'id': [56, 352] }; --- .../src/main/resources/Javascript/ApiClient.mustache | 10 +++++----- samples/client/petstore/javascript/src/ApiClient.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index d85705f5127..8a80d0d80b2 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -2,18 +2,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.{{moduleName}}) { root.{{moduleName}} = {}; } - root.{{moduleName}}.ApiClient = factory(root.superagent); + root.{{moduleName}}.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; {{#emitJSDoc}} /** @@ -383,7 +383,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 6d150160192..f9f2cb06945 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -14,18 +14,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.ApiClient = factory(root.superagent); + root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; /** @@ -386,7 +386,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { From 835c7c0e0c87752d7aaa10c07b094b9d09700545 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Mar 2017 16:49:00 +0800 Subject: [PATCH 049/132] [PHP][Silex] use original path name for path variable naming (#4817) * use original path name in php silex * fix path variable naming by camelizing the name --- .../codegen/languages/SilexServerCodegen.java | 29 +++++++++ .../src/main/resources/silex/index.mustache | 24 ++++---- .../petstore/silex/SwaggerServer/index.php | 60 +++++-------------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java index 9fe6eb2b34a..088d4bc5b03 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java @@ -3,6 +3,7 @@ package io.swagger.codegen.languages; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenType; +import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; import io.swagger.models.properties.ArrayProperty; @@ -13,6 +14,10 @@ import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig { protected String invokerPackage; @@ -213,4 +218,28 @@ public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } + + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + String path = new String(op.path); + String[] items = path.split("/", -1); + String opsPath = ""; + int pathParamIndex = 0; + + for (int i = 0; i < items.length; ++i) { + if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} + // camelize path variable + items[i] = "{" + camelize(items[i].substring(1, items[i].length()-1), true) + "}"; + } + } + + op.path = StringUtils.join(items, "/"); + } + + return objs; + } + } diff --git a/modules/swagger-codegen/src/main/resources/silex/index.mustache b/modules/swagger-codegen/src/main/resources/silex/index.mustache index 0ace4d41fda..41bef9c7c03 100644 --- a/modules/swagger-codegen/src/main/resources/silex/index.mustache +++ b/modules/swagger-codegen/src/main/resources/silex/index.mustache @@ -8,19 +8,23 @@ use Silex\Application; $app = new Silex\Application(); {{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} +{{#apis}} +{{#operations}} +{{#operation}} -$app->{{httpMethod}}('{{basePathWithoutHost}}{{path}}', function(Application $app, Request $request{{#pathParams}}, ${{paramName}}{{/pathParams}}) { - {{#queryParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/queryParams}} - {{#formParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/formParams}} - return new Response('How about implementing {{nickname}} as a {{httpMethod}} method ?'); +$app->{{httpMethod}}('{{basePathWithoutHost}}{{path}}', function(Application $app, Request $request{{#pathParams}}, ${{baseName}}{{/pathParams}}) { + {{#queryParams}} + ${{paramName}} = $request->get('{{paramName}}'); + {{/queryParams}} + {{#formParams}} + ${{paramName}} = $request->get('{{paramName}}'); + {{/formParams}} + return new Response('How about implementing {{operationId}} as a {{httpMethod}} method ?'); }); - {{/operation}} - {{/operations}} - {{/apis}} +{{/operation}} +{{/operations}} +{{/apis}} {{/apiInfo}} $app->run(); diff --git a/samples/server/petstore/silex/SwaggerServer/index.php b/samples/server/petstore/silex/SwaggerServer/index.php index 10b446e9974..ef5c65d8e73 100644 --- a/samples/server/petstore/silex/SwaggerServer/index.php +++ b/samples/server/petstore/silex/SwaggerServer/index.php @@ -9,141 +9,109 @@ $app = new Silex\Application(); $app->POST('/v2/pet', function(Application $app, Request $request) { - - return new Response('How about implementing addPet as a POST method ?'); }); -$app->DELETE('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - +$app->DELETE('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { return new Response('How about implementing deletePet as a DELETE method ?'); }); $app->GET('/v2/pet/findByStatus', function(Application $app, Request $request) { - $status = $request->get('status'); - + $status = $request->get('status'); return new Response('How about implementing findPetsByStatus as a GET method ?'); }); $app->GET('/v2/pet/findByTags', function(Application $app, Request $request) { - $tags = $request->get('tags'); - + $tags = $request->get('tags'); return new Response('How about implementing findPetsByTags as a GET method ?'); }); -$app->GET('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - +$app->GET('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { return new Response('How about implementing getPetById as a GET method ?'); }); $app->PUT('/v2/pet', function(Application $app, Request $request) { - - return new Response('How about implementing updatePet as a PUT method ?'); }); -$app->POST('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - $name = $request->get('name'); $status = $request->get('status'); +$app->POST('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { + $name = $request->get('name'); + $status = $request->get('status'); return new Response('How about implementing updatePetWithForm as a POST method ?'); }); -$app->POST('/v2/pet/{petId}/uploadImage', function(Application $app, Request $request, $pet_id) { - - $additional_metadata = $request->get('additional_metadata'); $file = $request->get('file'); +$app->POST('/v2/pet/{petId}/uploadImage', function(Application $app, Request $request, $petId) { + $additional_metadata = $request->get('additional_metadata'); + $file = $request->get('file'); return new Response('How about implementing uploadFile as a POST method ?'); }); -$app->DELETE('/v2/store/order/{orderId}', function(Application $app, Request $request, $order_id) { - - +$app->DELETE('/v2/store/order/{orderId}', function(Application $app, Request $request, $orderId) { return new Response('How about implementing deleteOrder as a DELETE method ?'); }); $app->GET('/v2/store/inventory', function(Application $app, Request $request) { - - return new Response('How about implementing getInventory as a GET method ?'); }); -$app->GET('/v2/store/order/{orderId}', function(Application $app, Request $request, $order_id) { - - +$app->GET('/v2/store/order/{orderId}', function(Application $app, Request $request, $orderId) { return new Response('How about implementing getOrderById as a GET method ?'); }); $app->POST('/v2/store/order', function(Application $app, Request $request) { - - return new Response('How about implementing placeOrder as a POST method ?'); }); $app->POST('/v2/user', function(Application $app, Request $request) { - - return new Response('How about implementing createUser as a POST method ?'); }); $app->POST('/v2/user/createWithArray', function(Application $app, Request $request) { - - return new Response('How about implementing createUsersWithArrayInput as a POST method ?'); }); $app->POST('/v2/user/createWithList', function(Application $app, Request $request) { - - return new Response('How about implementing createUsersWithListInput as a POST method ?'); }); $app->DELETE('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing deleteUser as a DELETE method ?'); }); $app->GET('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing getUserByName as a GET method ?'); }); $app->GET('/v2/user/login', function(Application $app, Request $request) { - $username = $request->get('username'); $password = $request->get('password'); - + $username = $request->get('username'); + $password = $request->get('password'); return new Response('How about implementing loginUser as a GET method ?'); }); $app->GET('/v2/user/logout', function(Application $app, Request $request) { - - return new Response('How about implementing logoutUser as a GET method ?'); }); $app->PUT('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing updateUser as a PUT method ?'); }); From fa803d5cf50a45e42c58cdb103758411e7ee4e8e Mon Sep 17 00:00:00 2001 From: gigo1980 Date: Fri, 3 Mar 2017 09:58:24 +0100 Subject: [PATCH 050/132] Adjust Date ISO Dateformat for Query Parameters: ISSUE 4745 (#4812) * Adjust Date ISO Dateformat for Query Parameters: ISSUE 4745 * Run Sample Model --- .../typescript-angular2/api.mustache | 16 +- .../typescript-angular2/.gitignore | 1 + .../typescript-angular2/api/FakeApi.ts | 29 +-- .../typescript-angular2/api/api.ts | 2 + .../typescript-angular2/variables.ts | 8 +- .../typescript-angular2/default/LICENSE | 201 ++++++++++++++++ .../typescript-angular2/default/api/PetApi.ts | 224 +++++++++--------- .../default/api/StoreApi.ts | 73 +++--- .../default/api/UserApi.ts | 136 ++++++----- .../typescript-angular2/default/api/api.ts | 4 - .../default/configuration.ts | 2 +- .../default/model/Category.ts | 12 + .../default/model/Order.ts | 12 + .../typescript-angular2/default/model/Pet.ts | 12 + .../typescript-angular2/default/model/Tag.ts | 12 + .../typescript-angular2/default/model/User.ts | 12 + .../typescript-angular2/default/variables.ts | 8 +- 17 files changed, 516 insertions(+), 248 deletions(-) create mode 100644 samples/client/petstore/typescript-angular2/default/LICENSE diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index 022840dae3d..eca28359c4b 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -92,11 +92,17 @@ export class {{classname}} { {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - if({{paramName}} instanceof Date) { - queryParameters.set('{{baseName}}', {{paramName}}.d.toISOString()); - } else { - queryParameters.set('{{baseName}}', {{paramName}}); - } + {{#isDateTime}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDate}} + {{^isDate}} + queryParameters.set('{{baseName}}', {{paramName}}); + {{/isDate}} + {{/isDateTime}} } {{/isListContainer}} diff --git a/samples/client/petstore-security-test/typescript-angular2/.gitignore b/samples/client/petstore-security-test/typescript-angular2/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore-security-test/typescript-angular2/.gitignore +++ b/samples/client/petstore-security-test/typescript-angular2/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts b/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts index 1cbd4d97048..390fddb18ee 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts @@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -40,21 +40,6 @@ export class FakeApi { } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * @@ -84,8 +69,6 @@ export class FakeApi { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let formParams = new URLSearchParams(); - - // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -97,13 +80,11 @@ export class FakeApi { 'application/json', '*_/ =end -- ' ]; - - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (test code inject * ' " =end rn n r !== undefined) { - formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); + formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); } let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -112,10 +93,10 @@ export class FakeApi { body: formParams.toString(), search: queryParameters }); - + // https://github.com/swagger-api/swagger-codegen/issues/4037 if (extraHttpRequestParams) { - requestOptions = this.extendObj(requestOptions, extraHttpRequestParams); + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } return this.http.request(path, requestOptions); diff --git a/samples/client/petstore-security-test/typescript-angular2/api/api.ts b/samples/client/petstore-security-test/typescript-angular2/api/api.ts index 9525ab85127..940c85b890d 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/api.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/api.ts @@ -1 +1,3 @@ export * from './FakeApi'; +import { FakeApi } from './FakeApi'; +export const APIS = [ FakeApi, ]; diff --git a/samples/client/petstore-security-test/typescript-angular2/variables.ts b/samples/client/petstore-security-test/typescript-angular2/variables.ts index 27b987e9b23..944e688f1b1 100644 --- a/samples/client/petstore-security-test/typescript-angular2/variables.ts +++ b/samples/client/petstore-security-test/typescript-angular2/variables.ts @@ -1,3 +1,9 @@ import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new OpaqueToken('basePath'); \ No newline at end of file +export const BASE_PATH = new OpaqueToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular2/default/LICENSE b/samples/client/petstore/typescript-angular2/default/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/client/petstore/typescript-angular2/default/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index 9806c35339c..c3cf9ca9e0f 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -19,7 +31,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -184,6 +196,8 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -195,30 +209,26 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -237,7 +247,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - headers.set('api_key', String(apiKey)); + // to determine the Content-Type header let consumes: string[] = [ @@ -248,27 +258,24 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -282,12 +289,11 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - if (status) { - status.forEach((element) => { - queryParameters.append('status', element); - }) + if (status !== undefined) { + queryParameters.set('status', status); } + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -297,27 +303,24 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -331,12 +334,11 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - if (tags) { - tags.forEach((element) => { - queryParameters.append('tags', element); - }) + if (tags !== undefined) { + queryParameters.set('tags', tags); } + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -346,27 +348,24 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -384,6 +383,8 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -393,32 +394,29 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } - // authentication (api_key) required - if (this.configuration.apiKey) { + if (this.configuration.apiKey) + { headers.set('api_key', this.configuration.apiKey); } + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -432,6 +430,8 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -443,30 +443,26 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -488,6 +484,8 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } + + // to determine the Content-Type header let consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -498,38 +496,32 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (name !== undefined) { - formParams.set('name', name); - } + if (name !== undefined) { + formParams.set('name', name); + } if (status !== undefined) { - formParams.set('status', status); + formParams.set('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -551,6 +543,8 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } + + // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' @@ -561,38 +555,32 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + if (this.configuration.accessToken) + { + headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); } - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); - } + if (additionalMetadata !== undefined) { + formParams.set('additionalMetadata', additionalMetadata); + } if (file !== undefined) { - formParams.set('file', file); + formParams.set('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index 744e5333386..38d67411809 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -19,7 +31,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -118,6 +130,8 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -127,18 +141,18 @@ export class StoreApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -151,6 +165,8 @@ export class StoreApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -160,23 +176,23 @@ export class StoreApi { 'application/json', 'application/xml' ]; - + // authentication (api_key) required - if (this.configuration.apiKey) { + if (this.configuration.apiKey) + { headers.set('api_key', this.configuration.apiKey); } + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -194,6 +210,8 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -203,18 +221,18 @@ export class StoreApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -228,6 +246,8 @@ export class StoreApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -237,21 +257,20 @@ export class StoreApi { 'application/json', 'application/xml' ]; + + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index 2c15efc9ee5..4844041bce9 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -19,7 +31,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -180,6 +192,8 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -189,21 +203,20 @@ export class UserApi { 'application/json', 'application/xml' ]; + + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -217,6 +230,8 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -226,21 +241,20 @@ export class UserApi { 'application/json', 'application/xml' ]; + + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -254,6 +268,8 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -263,21 +279,20 @@ export class UserApi { 'application/json', 'application/xml' ]; + + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -295,6 +310,8 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -304,18 +321,18 @@ export class UserApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -333,6 +350,8 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -342,18 +361,18 @@ export class UserApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -369,20 +388,12 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (username !== undefined) { - if(username instanceof Date) { - queryParameters.set('username', username.d.toISOString()); - } else { - queryParameters.set('username', username); - } + queryParameters.set('username', username); + } + if (password !== undefined) { + queryParameters.set('password', password); } - if (password !== undefined) { - if(password instanceof Date) { - queryParameters.set('password', password.d.toISOString()); - } else { - queryParameters.set('password', password); - } - } // to determine the Content-Type header let consumes: string[] = [ @@ -393,18 +404,18 @@ export class UserApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -417,6 +428,8 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -426,18 +439,18 @@ export class UserApi { 'application/json', 'application/xml' ]; + + + + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } @@ -456,6 +469,8 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } + + // to determine the Content-Type header let consumes: string[] = [ ]; @@ -465,21 +480,20 @@ export class UserApi { 'application/json', 'application/xml' ]; + + headers.set('Content-Type', 'application/json'); + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters + search: queryParameters, + responseType: ResponseContentType.Json }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/api.ts b/samples/client/petstore/typescript-angular2/default/api/api.ts index 0d1e9f047fd..056206bfaca 100644 --- a/samples/client/petstore/typescript-angular2/default/api/api.ts +++ b/samples/client/petstore/typescript-angular2/default/api/api.ts @@ -1,7 +1,3 @@ export * from './PetApi'; -import { PetApi } from './PetApi'; export * from './StoreApi'; -import { StoreApi } from './StoreApi'; export * from './UserApi'; -import { UserApi } from './UserApi'; -export const APIS = [ PetApi, StoreApi, UserApi, ]; diff --git a/samples/client/petstore/typescript-angular2/default/configuration.ts b/samples/client/petstore/typescript-angular2/default/configuration.ts index a566a180e4e..94989933b63 100644 --- a/samples/client/petstore/typescript-angular2/default/configuration.ts +++ b/samples/client/petstore/typescript-angular2/default/configuration.ts @@ -2,5 +2,5 @@ export class Configuration { apiKey: string; username: string; password: string; - accessToken: string | (() => string); + accessToken: string; } \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular2/default/model/Category.ts b/samples/client/petstore/typescript-angular2/default/model/Category.ts index ffdacd4f707..4ab562b6d3b 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Category.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Category.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Order.ts b/samples/client/petstore/typescript-angular2/default/model/Order.ts index 9c47071c5b6..8fdad0357f4 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Order.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Order.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Pet.ts b/samples/client/petstore/typescript-angular2/default/model/Pet.ts index d64dc809e53..14b0c4ced46 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Pet.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Pet.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Tag.ts b/samples/client/petstore/typescript-angular2/default/model/Tag.ts index 8a3b99ae9ca..2e1bf1572e1 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Tag.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Tag.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/User.ts b/samples/client/petstore/typescript-angular2/default/model/User.ts index 43d00f7b318..efb2351b234 100644 --- a/samples/client/petstore/typescript-angular2/default/model/User.ts +++ b/samples/client/petstore/typescript-angular2/default/model/User.ts @@ -8,6 +8,18 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/variables.ts b/samples/client/petstore/typescript-angular2/default/variables.ts index 944e688f1b1..27b987e9b23 100644 --- a/samples/client/petstore/typescript-angular2/default/variables.ts +++ b/samples/client/petstore/typescript-angular2/default/variables.ts @@ -1,9 +1,3 @@ import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new OpaqueToken('basePath'); -export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} \ No newline at end of file +export const BASE_PATH = new OpaqueToken('basePath'); \ No newline at end of file From dbe99c3af92ebc4862e7984a246b9af5e707013d Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Mar 2017 16:59:23 +0800 Subject: [PATCH 051/132] fix path variable in ts angular2 (#4756) --- .../typescript-angular2/api.mustache | 3 ++- .../typescript-angular2/default/api/PetApi.ts | 20 +++++++++++-------- .../default/api/StoreApi.ts | 10 ++++++---- .../default/api/UserApi.ts | 19 ++++++++++-------- .../typescript-angular2/npm/README.md | 4 ++-- .../typescript-angular2/npm/api/PetApi.ts | 20 +++++++++++-------- .../typescript-angular2/npm/api/StoreApi.ts | 10 ++++++---- .../typescript-angular2/npm/api/UserApi.ts | 19 ++++++++++-------- .../typescript-angular2/npm/package.json | 2 +- 9 files changed, 63 insertions(+), 44 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index eca28359c4b..c34b1c85dc1 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -61,7 +61,8 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { - const path = this.basePath + `{{path}}`; + const path = this.basePath + '{{path}}'{{#pathParams}} + .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index c3cf9ca9e0f..502e8d2adda 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -192,7 +192,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -239,7 +239,8 @@ export class PetApi { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -285,7 +286,7 @@ export class PetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -330,7 +331,7 @@ export class PetApi { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -375,7 +376,8 @@ export class PetApi { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -426,7 +428,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -474,7 +476,8 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -533,7 +536,8 @@ export class PetApi { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index 38d67411809..e10a1281c22 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -122,7 +122,8 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -161,7 +162,7 @@ export class StoreApi { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -202,7 +203,8 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -242,7 +244,7 @@ export class StoreApi { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: models.Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index 4844041bce9..96868788a9c 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -188,7 +188,7 @@ export class UserApi { * @param body Created user object */ public createUserWithHttpInfo(body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -226,7 +226,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -264,7 +264,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -302,7 +302,8 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -342,7 +343,8 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -383,7 +385,7 @@ export class UserApi { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -424,7 +426,7 @@ export class UserApi { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -461,7 +463,8 @@ export class UserApi { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index d5e4636d3c9..bf59448d8e8 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index 9806c35339c..26ee01017f7 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -180,7 +180,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -229,7 +229,8 @@ export class PetApi { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -278,7 +279,7 @@ export class PetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -327,7 +328,7 @@ export class PetApi { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -376,7 +377,8 @@ export class PetApi { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -428,7 +430,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -478,7 +480,8 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -541,7 +544,8 @@ export class PetApi { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts index 744e5333386..b84d8f6a4f8 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts @@ -110,7 +110,8 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -147,7 +148,7 @@ export class StoreApi { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -186,7 +187,8 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -224,7 +226,7 @@ export class StoreApi { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: models.Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index 2c15efc9ee5..3db8a332039 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -176,7 +176,7 @@ export class UserApi { * @param body Created user object */ public createUserWithHttpInfo(body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -213,7 +213,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -250,7 +250,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -287,7 +287,8 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -325,7 +326,8 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -364,7 +366,7 @@ export class UserApi { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -413,7 +415,7 @@ export class UserApi { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -448,7 +450,8 @@ export class UserApi { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index f0a54da13d5..e1c5d927281 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201702031824", + "version": "0.0.1-SNAPSHOT.201702090204", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [ From 39a42d014beaf5e77d2e797e1361daffd19eb291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Ber=C3=A9nyi?= Date: Fri, 3 Mar 2017 01:00:20 -0800 Subject: [PATCH 052/132] Feature/issue 4698 rxjava2 support (#4743) * rx2 support * NO_NOT_USE_RX is for internal use only; plus sanity check if both v1 and v2 are specified * minor fixes * one more small fix --- .../codegen/languages/JavaClientCodegen.java | 27 +++++++++++++++++-- .../libraries/retrofit2/ApiClient.mustache | 2 ++ .../Java/libraries/retrofit2/api.mustache | 5 ++-- .../libraries/retrofit2/build.gradle.mustache | 7 +++++ .../libraries/retrofit2/build.sbt.mustache | 4 +++ .../Java/libraries/retrofit2/pom.mustache | 15 +++++++++++ .../options/JavaClientOptionsProvider.java | 1 + 7 files changed, 57 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index ab4345f997a..1285391cef5 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -20,6 +20,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen private static final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); public static final String USE_RX_JAVA = "useRxJava"; + public static final String USE_RX_JAVA2 = "useRxJava2"; + public static final String DO_NOT_USE_RX = "doNotUseRx"; public static final String USE_PLAY24_WS = "usePlay24WS"; public static final String PARCELABLE_MODEL = "parcelableModel"; @@ -28,6 +30,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected String gradleWrapperPackage = "gradle.wrapper"; protected boolean useRxJava = false; + protected boolean useRxJava2 = false; + protected boolean doNotUseRx = true; // backwards compatibility for swagger configs that specify neither rx1 nor rx2 (mustache does not allow for boolean operators so we need this extra field) protected boolean usePlay24WS = false; protected boolean parcelableModel = false; protected boolean useBeanValidation = false; @@ -43,6 +47,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen modelPackage = "io.swagger.client.model"; cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library.")); cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(USE_PLAY24_WS, "Use Play! 2.4 Async HTTP client (Play WS API)")); cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library.")); @@ -54,7 +59,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.22.2. JSON processing: Jackson 2.7.0"); supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'"); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); - supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava=true'. (RxJava 1.1.3)"); + supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -84,9 +89,17 @@ public class JavaClientCodegen extends AbstractJavaCodegen public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(USE_RX_JAVA)) { + if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) { + LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2."); + } else if (additionalProperties.containsKey(USE_RX_JAVA)) { this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString())); } + if (additionalProperties.containsKey(USE_RX_JAVA2)) { + this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString())); + } + if (!useRxJava && !useRxJava2) { + additionalProperties.put(DO_NOT_USE_RX, true); + } if (additionalProperties.containsKey(USE_PLAY24_WS)) { this.setUsePlay24WS(Boolean.valueOf(additionalProperties.get(USE_PLAY24_WS).toString())); } @@ -335,6 +348,16 @@ public class JavaClientCodegen extends AbstractJavaCodegen public void setUseRxJava(boolean useRxJava) { this.useRxJava = useRxJava; + doNotUseRx = false; + } + + public void setUseRxJava2(boolean useRxJava2) { + this.useRxJava2 = useRxJava2; + doNotUseRx = false; + } + + public void setDoNotUseRx(boolean doNotUseRx) { + this.doNotUseRx = doNotUseRx; } public void setUsePlay24WS(boolean usePlay24WS) { diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index cc6b993e6ab..6c2502db8d8 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -23,6 +23,7 @@ import java.time.format.DateTimeFormatter; import retrofit2.Converter; import retrofit2.Retrofit; {{#useRxJava}}import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;{{/useRxJava}} +{{#useRxJava2}}import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;{{/useRxJava2}} import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; @@ -150,6 +151,7 @@ public class ApiClient { .Builder() .baseUrl(baseUrl) {{#useRxJava}}.addCallAdapterFactory(RxJavaCallAdapterFactory.create()){{/useRxJava}} + {{#useRxJava2}}.addCallAdapterFactory(RxJava2CallAdapterFactory.create()){{/useRxJava2}} .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } 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 b72af4f1703..1ce3dc62502 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 @@ -3,7 +3,8 @@ package {{package}}; import {{invokerPackage}}.CollectionFormats.*; {{#useRxJava}}import rx.Observable;{{/useRxJava}} -{{^useRxJava}}import retrofit2.Call;{{/useRxJava}} +{{#useRxJava2}}import io.reactivex.Observable;{{/useRxJava2}} +{{#doNotUseRx}}import retrofit2.Call;{{/doNotUseRx}} import retrofit2.http.*; import okhttp3.RequestBody; @@ -46,7 +47,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{path}}") - {{^usePlay24WS}}{{#useRxJava}}Observable{{/useRxJava}}{{^useRxJava}}Call{{/useRxJava}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}} + {{^usePlay24WS}}{{^doNotUseRx}}Observable{{/doNotUseRx}}{{#doNotUseRx}}Call{{/doNotUseRx}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} );{{/hasMore}}{{/allParams}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 353d70eafdc..407c7ab6b02 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -101,6 +101,9 @@ ext { {{#useRxJava}} rx_java_version = "1.1.3" {{/useRxJava}} + {{#useRxJava2}} + rx_java_version = "2.0.5" + {{/useRxJava2}} {{^java8}} jodatime_version = "2.9.3" {{/java8}} @@ -114,6 +117,10 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" compile "io.reactivex:rxjava:$rx_java_version" {{/useRxJava}} + {{#useRxJava2}} + compile "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0" + compile "io.reactivex.rxjava2:rxjava:$rx_java_version" + {{/useRxJava2}} compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" {{^java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index ac9f49c1417..f7aa5996409 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -16,6 +16,10 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "adapter-rxjava" % "2.0.2" % "compile", "io.reactivex" % "rxjava" % "1.1.3" % "compile", {{/useRxJava}} + {{#useRxJava2}} + "com.jakewharton.retrofit" % "retrofit2-rxjava2-adapter" % "1.0.0" % "compile", + "io.reactivex.rxjava2" % "rxjava" % "2.0.5" % "compile", + {{/useRxJava2}} "io.swagger" % "swagger-annotations" % "1.5.8" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", {{^java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index 76c416904cb..4e5519c8745 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -213,6 +213,18 @@ ${retrofit-version} {{/useRxJava}} + {{#useRxJava2}} + + io.reactivex.rxjava2 + rxjava + ${rxjava-version} + + + com.jakewharton.retrofit + retrofit2-rxjava2-adapter + 1.0.0 + + {{/useRxJava2}} {{#usePlay24WS}} @@ -269,6 +281,9 @@ {{#useRxJava}} 1.1.6 {{/useRxJava}} + {{#useRxJava2}} + 2.0.5 + {{/useRxJava2}} {{^java8}} 2.9.4 {{/java8}} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java index 1fb1b86604d..cc0f3217403 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java @@ -17,6 +17,7 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider { Map options = new HashMap(super.createOptions()); options.put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY_VALUE); options.put(JavaClientCodegen.USE_RX_JAVA, "false"); + options.put(JavaClientCodegen.USE_RX_JAVA2, "false"); options.put(JavaClientCodegen.USE_PLAY24_WS, "false"); options.put(JavaClientCodegen.PARCELABLE_MODEL, "false"); options.put(JavaClientCodegen.SUPPORT_JAVA6, "false"); From e23a24c138bcc237cd699c1974c2a4890c41dd1b Mon Sep 17 00:00:00 2001 From: patulacci Date: Fri, 3 Mar 2017 10:29:16 +0100 Subject: [PATCH 053/132] replaced SWG by classPrefix and ran tests (#4871) --- .../resources/objc/ApiClient-body.mustache | 20 +- .../resources/objc/ApiClient-header.mustache | 2 +- .../petstore-security-test/objc/README.md | 27 +- .../objc/SwaggerClient.podspec | 8 +- .../objc/SwaggerClient/Api/SWGFakeApi.h | 31 +- .../objc/SwaggerClient/Api/SWGFakeApi.m | 59 +-- .../Core/JSONValueTransformer+ISO8601.h | 22 +- .../Core/JSONValueTransformer+ISO8601.m | 1 + .../objc/SwaggerClient/Core/SWGApi.h | 33 +- .../objc/SwaggerClient/Core/SWGApiClient.h | 192 ++------- .../objc/SwaggerClient/Core/SWGApiClient.m | 398 ++++++------------ .../SwaggerClient/Core/SWGConfiguration.h | 143 ++----- .../Core/SWGJSONRequestSerializer.h | 21 +- .../objc/SwaggerClient/Core/SWGLogger.h | 21 +- .../objc/SwaggerClient/Core/SWGLogger.m | 3 +- .../objc/SwaggerClient/Core/SWGObject.h | 21 +- .../objc/SwaggerClient/Core/SWGObject.m | 29 ++ .../Core/SWGQueryParamCollection.h | 21 +- .../Core/SWGQueryParamCollection.m | 12 +- .../Core/SWGResponseDeserializer.h | 23 +- .../Core/SWGResponseDeserializer.m | 42 +- .../objc/SwaggerClient/Core/SWGSanitizer.h | 23 +- .../objc/SwaggerClient/Core/SWGSanitizer.m | 10 +- .../objc/SwaggerClient/Model/SWGReturn.h | 23 +- .../objc/SwaggerClient/Model/SWGReturn.m | 2 +- .../objc/docs/SWGFakeApi.md | 22 +- .../objc/docs/SWGReturn.md | 2 +- .../client/petstore/objc/default/README.md | 17 +- .../objc/default/SwaggerClient.podspec | 2 +- .../default/SwaggerClient/Api/SWGPetApi.h | 17 +- .../default/SwaggerClient/Api/SWGPetApi.m | 4 +- .../default/SwaggerClient/Api/SWGStoreApi.h | 13 +- .../default/SwaggerClient/Api/SWGUserApi.h | 13 +- .../default/SwaggerClient/Core/SWGApiClient.h | 13 +- .../default/SwaggerClient/Core/SWGApiClient.m | 14 +- .../SwaggerClient/Core/SWGConfiguration.h | 13 +- .../Core/SWGDefaultConfiguration.h | 19 +- .../Core/SWGDefaultConfiguration.m | 14 +- 38 files changed, 432 insertions(+), 918 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache index 7e56be1491b..97b1b0ad993 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache @@ -75,8 +75,8 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; - SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; - _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + {{classPrefix}}JSONRequestSerializer * swgjsonRequestSerializer = [{{classPrefix}}JSONRequestSerializer serializer]; + _requestSerializerForContentType = @{k{{classPrefix}}ApplicationJSONType : swgjsonRequestSerializer, @"application/x-www-form-urlencoded": afhttpRequestSerializer, @"multipart/form-data": afhttpRequestSerializer }; @@ -89,7 +89,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) #pragma mark - Task Methods - (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { {{classPrefix}}DebugLogResponse(response, responseObject,request,error); if(!error) { @@ -104,7 +104,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - + return task; } @@ -135,7 +135,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(file, nil); }]; - + return task; } @@ -157,7 +157,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; - __weak id sanitizer = self.sanitizer; + __weak id<{{classPrefix}}Sanitizer> sanitizer = self.sanitizer; // sanitize parameters pathParams = [sanitizer sanitizeForSerialization:pathParams]; @@ -222,7 +222,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) [self postProcessRequest:request]; - + NSURLSessionTask *task = nil; if ([self.downloadTaskResponseTypes containsObject:responseType]) { @@ -241,9 +241,9 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(response, error); }]; } - + [task resume]; - + return task; } @@ -330,7 +330,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - + id<{{classPrefix}}Configuration> config = self.configuration; for (NSString *auth in authSettings) { NSDictionary *authSetting = config.authSettings[auth]; diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache index 6cfcd2fae4c..f50a372eb98 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -54,7 +54,7 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; * @param url The base url * @param configuration The configuration implementation */ -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id<{{classPrefix}}Configuration>)configuration; /** * Performs request diff --git a/samples/client/petstore-security-test/objc/README.md b/samples/client/petstore-security-test/objc/README.md index 3365aba9056..c56b13119e4 100644 --- a/samples/client/petstore-security-test/objc/README.md +++ b/samples/client/petstore-security-test/objc/README.md @@ -1,13 +1,12 @@ # SwaggerClient -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r +- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r - Package version: -- Build date: 2016-07-12T17:06:42.405+08:00 -- Build package: class io.swagger.codegen.languages.ObjcClientCodegen +- Build package: io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -40,7 +39,7 @@ Import the following: ```objc #import -#import +#import // load models #import // load API classes for accessing endpoints @@ -50,7 +49,7 @@ Import the following: ## Recommendation -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue. +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. ## Getting Started @@ -59,11 +58,11 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -NSString* *testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +NSString* *testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) SWGFakeApi *apiInstance = [[SWGFakeApi alloc] init]; -// To test code injection *_/ ' \" =end \\r\\n \\n \\r +// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r [apiInstance testCodeInjectEndRnNRWithTestCodeInjectEndRnNR:testCodeInjectEndRnNR completionHandler: ^(NSError* error) { if (error) { @@ -75,11 +74,11 @@ SWGFakeApi *apiInstance = [[SWGFakeApi alloc] init]; ## Documentation for API Endpoints -All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r* +All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SWGFakeApi* | [**testCodeInjectEndRnNR**](docs/SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r +*SWGFakeApi* | [**testCodeInjectEndRnNR**](docs/SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r ## Documentation For Models @@ -93,7 +92,7 @@ Class | Method | HTTP request | Description ## api_key - **Type**: API key -- **API key parameter name**: api_key */ ' " =end \r\n \n \r +- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r - **Location**: HTTP header ## petstore_auth @@ -102,12 +101,12 @@ Class | Method | HTTP request | Description - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - - **write:pets**: modify pets in your account */ ' " =end \r\n \n \r - - **read:pets**: read your pets */ ' " =end \r\n \n \r + - **write:pets**: modify pets in your account *_/ ' \" =end -- \\r\\n \\n \\r + - **read:pets**: read your pets *_/ ' \" =end -- \\r\\n \\n \\r ## Author -apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r diff --git a/samples/client/petstore-security-test/objc/SwaggerClient.podspec b/samples/client/petstore-security-test/objc/SwaggerClient.podspec index b3ef54ca1de..1cdaaf79222 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient.podspec +++ b/samples/client/petstore-security-test/objc/SwaggerClient.podspec @@ -11,9 +11,9 @@ Pod::Spec.new do |s| s.name = "SwaggerClient" s.version = "1.0.0" - s.summary = "Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r" + s.summary = "Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r" s.description = <<-DESC - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- DESC s.platform = :ios, '7.0' @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.framework = 'SystemConfiguration' s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.license = "Apache License, Version 2.0" + s.license = "Proprietary" s.source = { :git => "https://github.com/swagger-api/swagger-codegen.git", :tag => "#{s.version}" } s.author = { "Swagger" => "apiteam@swagger.io" } @@ -32,6 +32,6 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.5' + s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h index 50daf69d833..bea37df4acb 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h @@ -2,46 +2,35 @@ #import "SWGApi.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGFakeApi: NSObject extern NSString* kSWGFakeApiErrorDomain; extern NSInteger kSWGFakeApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; -/// To test code injection *_/ ' \" =end \\r\\n \\n \\r +/// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r /// /// -/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) /// -/// code:400 message:"To test code injection *_/ ' \" =end \\r\\n \\n \\r" +/// code:400 message:"To test code injection *_/ ' \" =end -- \\r\\n \\n \\r" /// /// @return --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m index 33c15278886..e0a90fbcdb7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m @@ -1,10 +1,11 @@ #import "SWGFakeApi.h" #import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" @interface SWGFakeApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; @end @@ -18,64 +19,43 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; } return self; } #pragma mark - -+ (instancetype)sharedAPI { - static SWGFakeApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { - return self.defaultHeaders[key]; -} - --(void) addHeader:(NSString*)value forKey:(NSString*)key { - [self setDefaultHeaderValue:value forKey:key]; + return self.mutableDefaultHeaders[key]; } -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.defaultHeaders setValue:value forKey:key]; + [self.mutableDefaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; } #pragma mark - Api Methods /// -/// To test code injection *_/ ' \" =end \\r\\n \\n \\r +/// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r /// -/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) /// /// @returns void /// --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/fake"]; @@ -88,9 +68,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"*/ ' =end - - "]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"*_/ ' =end -- "]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -99,9 +77,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"*/ ' =end - - "]]; + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"*_/ ' =end -- "]]; // Authentication setting NSArray *authSettings = @[]; @@ -110,7 +86,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; if (testCodeInjectEndRnNR) { - formParams[@"test code inject */ ' " =end \r\n \n \r"] = testCodeInjectEndRnNR; + formParams[@"test code inject */ ' " =end -- \r\n \n \r"] = testCodeInjectEndRnNR; } return [self.apiClient requestWithPath: resourcePath @@ -129,8 +105,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index e91fb24ebcf..0cf26e056c7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -1,31 +1,19 @@ #import -#import #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface JSONValueTransformer (ISO8601) @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index cec8bdeea27..b544a1dae58 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,3 +1,4 @@ +#import #import "JSONValueTransformer+ISO8601.h" @implementation JSONValueTransformer (ISO8601) diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h index 754b95d7b44..5082262a432 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h @@ -1,42 +1,29 @@ #import -#import "SWGObject.h" -#import "SWGApiClient.h" + +@class SWGApiClient; /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @protocol SWGApi -@property(nonatomic, assign) SWGApiClient *apiClient; +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; --(id) initWithApiClient:(SWGApiClient *)apiClient; - --(void) addHeader:(NSString*)value forKey:(NSString*)key DEPRECATED_MSG_ATTRIBUTE("setDefaultHeaderValue:forKey:"); +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; -(NSString*) defaultHeaderForKey:(NSString*)key; --(NSUInteger) requestQueueSize; +-(NSDictionary *)defaultHeaders; @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h index 3421219f37d..f4c35e17a52 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h @@ -1,43 +1,20 @@ -#import -#import #import -#import "SWGJSONResponseSerializer.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" #import "SWGConfiguration.h" #import "SWGResponseDeserializer.h" #import "SWGSanitizer.h" -#import "SWGLogger.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ -#import "SWGReturn.h" - - - -@class SWGConfiguration; /** * A key for `NSError` user info dictionaries. @@ -46,117 +23,49 @@ */ extern NSString *const SWGResponseObjectErrorKey; + @interface SWGApiClient : AFHTTPSessionManager -@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; -@property(nonatomic, assign) NSTimeInterval timeoutInterval; -@property(nonatomic, readonly) NSOperationQueue* queue; +@property (nonatomic, strong, readonly) id configuration; -/// In order to ensure the HTTPResponseHeaders are correct, it is recommended to initialize one SWGApiClient instance per thread. -@property(nonatomic, readonly) NSDictionary* HTTPResponseHeaders; +@property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, strong) id responseDeserializer; @property(nonatomic, strong) id sanitizer; -/** - * Clears Cache - */ -+(void)clearCache; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; /** - * Turns on cache - * - * @param enabled If the cached is enable, must be `YES` or `NO` + * Gets client singleton instance */ -+(void)setCacheEnabled:(BOOL) enabled; ++ (instancetype) sharedClient; -/** - * Gets the request queue size - * - * @return The size of `queuedRequests` static variable. - */ -+(NSUInteger)requestQueueSize; - -/** - * Sets the client unreachable - * - * @param state off line state, must be `YES` or `NO` - */ -+(void) setOfflineState:(BOOL) state; - -/** - * Gets if the client is unreachable - * - * @return The client offline state - */ -+(BOOL) getOfflineState; - -/** - * Sets the client reachability, this may be overridden by the reachability manager if reachability changes - * - * @param The client reachability. - */ -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; - -/** - * Gets the client reachability - * - * @return The client reachability. - */ -+(AFNetworkReachabilityStatus) getReachabilityStatus; - -/** - * Gets the next request id - * - * @return The next executed request id. - */ -+(NSNumber*) nextRequestId; - -/** - * Generates request id and add it to the queue - * - * @return The next executed request id. - */ -+(NSNumber*) queueRequest; - -/** - * Removes request id from the queue - * - * @param requestId The request which will be removed. - */ -+(void) cancelRequest:(NSNumber*)requestId; - -/** - * Customizes the behavior when the reachability changed - * - * @param changeBlock The block will be executed when the reachability changed. - */ -+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock; - -/** - * Sets the api client reachability strategy - */ -- (void)configureCacheReachibility; - -/** - * Sets header for request - * - * @param value The header value - * @param forKey The header key - */ --(void)setHeaderValue:(NSString*) value - forKey:(NSString*) forKey; /** * Updates header parameters and query parameters for authentication * - * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param headers The header parameter will be udpated, passed by pointer to pointer. * @param querys The query parameters will be updated, passed by pointer to pointer. * @param authSettings The authentication names NSArray. */ -- (void) updateHeaderParams:(NSDictionary **)headers - queryParams:(NSDictionary **)querys - WithAuthSettings:(NSArray *)authSettings; +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; /** * Performs request @@ -172,35 +81,20 @@ extern NSString *const SWGResponseObjectErrorKey; * @param responseContentType Response content-type. * @param completionBlock The block will be executed when the request completed. * - * @return The request id. + * @return The created session task. */ --(NSNumber*) requestWithPath:(NSString*) path - method:(NSString*) method - pathParams:(NSDictionary *) pathParams - queryParams:(NSDictionary*) queryParams - formParams:(NSDictionary *) formParams - files:(NSDictionary *) files - body:(id) body - headerParams:(NSDictionary*) headerParams - authSettings:(NSArray *) authSettings - requestContentType:(NSString*) requestContentType - responseContentType:(NSString*) responseContentType - responseType:(NSString *) responseType - completionBlock:(void (^)(id, NSError *))completionBlock; - -/** - * Custom security policy - * - * @return AFSecurityPolicy - */ -- (AFSecurityPolicy *) customSecurityPolicy; - -/** - * SWGConfiguration return sharedConfig - * - * @return SWGConfiguration - */ -- (SWGConfiguration*) configuration; - +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m index f004200b2eb..4b1d014d2bc 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m @@ -1,14 +1,13 @@ + +#import "SWGLogger.h" #import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; -static NSUInteger requestId = 0; -static bool offlineState = false; -static NSMutableSet * queuedRequests = nil; -static bool cacheEnabled = false; -static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; -static void (^reachabilityChangeBlock)(int); - +static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { if(![response isKindOfClass:[NSHTTPURLResponse class]]) { @@ -19,179 +18,80 @@ static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSDictionary * headers = SWG__headerFieldsForResponse(response); - if(!headers[@"Content-Disposition"]) { + if(!headers[kSWGContentDispositionKey]) { return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; } NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; - NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern - options:NSRegularExpressionCaseInsensitive - error:nil]; - NSString *contentDispositionHeader = headers[@"Content-Disposition"]; - NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader - options:0 - range:NSMakeRange(0, [contentDispositionHeader length])]; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; } @interface SWGApiClient () -@property (nonatomic, strong) NSDictionary* HTTPResponseHeaders; +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; @end @implementation SWGApiClient +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + - (instancetype)init { - NSString *baseUrl = [[SWGConfiguration sharedConfig] host]; - return [self initWithBaseURL:[NSURL URLWithString:baseUrl]]; + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; } - (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { self = [super initWithBaseURL:url]; if (self) { - self.timeoutInterval = 60; - self.requestSerializer = [AFJSONRequestSerializer serializer]; - self.responseSerializer = [AFJSONResponseSerializer serializer]; - self.securityPolicy = [self customSecurityPolicy]; - self.responseDeserializer = [[SWGResponseDeserializer alloc] init]; - self.sanitizer = [[SWGSanitizer alloc] init]; - // configure reachability - [self configureCacheReachibility]; + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; } return self; } -+ (void)initialize { - if (self == [SWGApiClient class]) { - queuedRequests = [[NSMutableSet alloc] init]; - // initialize URL cache - [self configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; - } -} +#pragma mark - Task Methods -#pragma mark - Setter Methods +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { -+ (void) setOfflineState:(BOOL) state { - offlineState = state; -} - -+ (void) setCacheEnabled:(BOOL)enabled { - cacheEnabled = enabled; -} - -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status { - reachabilityStatus = status; -} - -- (void)setHeaderValue:(NSString*) value forKey:(NSString*) forKey { - [self.requestSerializer setValue:value forHTTPHeaderField:forKey]; -} - -- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { - [super setRequestSerializer:requestSerializer]; - requestSerializer.timeoutInterval = self.timeoutInterval; -} - -#pragma mark - Cache Methods - -+(void)clearCache { - [[NSURLCache sharedURLCache] removeAllCachedResponses]; -} - -+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize - diskSize: (unsigned long) diskSize { - NSAssert(memorySize > 0, @"invalid in-memory cache size"); - NSAssert(diskSize >= 0, @"invalid disk cache size"); - - NSURLCache *cache = - [[NSURLCache alloc] - initWithMemoryCapacity:memorySize - diskCapacity:diskSize - diskPath:@"swagger_url_cache"]; - - [NSURLCache setSharedURLCache:cache]; -} - -#pragma mark - Request Methods - -+(NSUInteger)requestQueueSize { - return [queuedRequests count]; -} - -+(NSNumber*) nextRequestId { - @synchronized(self) { - return @(++requestId); - } -} - -+(NSNumber*) queueRequest { - NSNumber* requestId = [[self class] nextRequestId]; - SWGDebugLog(@"added %@ to request queue", requestId); - [queuedRequests addObject:requestId]; - return requestId; -} - -+(void) cancelRequest:(NSNumber*)requestId { - [queuedRequests removeObject:requestId]; -} - --(Boolean) executeRequestWithId:(NSNumber*) requestId { - NSSet* matchingItems = [queuedRequests objectsPassingTest:^BOOL(id obj, BOOL *stop) { - return [obj intValue] == [requestId intValue]; - }]; - - if (matchingItems.count == 1) { - SWGDebugLog(@"removed request id %@", requestId); - [queuedRequests removeObject:requestId]; - return YES; - } else { - return NO; - } -} - -#pragma mark - Reachability Methods - -+(AFNetworkReachabilityStatus) getReachabilityStatus { - return reachabilityStatus; -} - -+(BOOL) getOfflineState { - return offlineState; -} - -+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock { - reachabilityChangeBlock = changeBlock; -} - -- (void) configureCacheReachibility { - [self.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { - reachabilityStatus = status; - SWGDebugLog(@"reachability changed to %@",AFStringFromNetworkReachabilityStatus(status)); - [SWGApiClient setOfflineState:status == AFNetworkReachabilityStatusUnknown || status == AFNetworkReachabilityStatusNotReachable]; - - // call the reachability block, if configured - if (reachabilityChangeBlock != nil) { - reachabilityChangeBlock(status); - } - }]; - - [self.reachabilityManager startMonitoring]; -} - -#pragma mark - Operation Methods - -- (void) operationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); if(!error) { completionBlock(responseObject, nil); return; @@ -204,20 +104,17 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - [op resume]; + + return task; } -- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { SWGDebugLogResponse(response, responseObject,request,error); + if(error) { NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { @@ -225,9 +122,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { } NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); + return; } - NSString *directory = [self configuration].tempFolderPath ?: NSTemporaryDirectory(); - NSString * filename = SWG__fileNameForResponse(response); + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); NSString *filepath = [directory stringByAppendingPathComponent:filename]; NSURL *file = [NSURL fileURLWithPath:filepath]; @@ -236,53 +135,37 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - [op resume]; + + return task; } -#pragma mark - Perform Request Methods +#pragma mark - Perform Request Methods --(NSNumber*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { - // setting request serializer - if ([requestContentType isEqualToString:@"application/json"]) { - self.requestSerializer = [SWGJSONRequestSerializer serializer]; - } - else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - } - else if ([requestContentType isEqualToString:@"multipart/form-data"]) { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - } - else { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - NSAssert(NO, @"Unsupported request type %@", requestContentType); - } +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { - // setting response serializer - if ([responseContentType isEqualToString:@"application/json"]) { - self.responseSerializer = [SWGJSONResponseSerializer serializer]; - } else { - self.responseSerializer = [AFHTTPResponseSerializer serializer]; - } + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; // sanitize parameters - pathParams = [self.sanitizer sanitizeForSerialization:pathParams]; - queryParams = [self.sanitizer sanitizeForSerialization:queryParams]; - headerParams = [self.sanitizer sanitizeForSerialization:headerParams]; - formParams = [self.sanitizer sanitizeForSerialization:formParams]; + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; if(![body isKindOfClass:[NSData class]]) { - body = [self.sanitizer sanitizeForSerialization:body]; + body = [sanitizer sanitizeForSerialization:body]; } // auth setting @@ -295,22 +178,19 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; }]; - NSMutableURLRequest * request = nil; - NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; if ([pathWithQueryParams hasPrefix:@"/"]) { pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; } NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; if (files.count > 0) { - __weak __typeof(self)weakSelf = self; - request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" - URLString:urlString - parameters:nil - constructingBodyWithBlock:^(id formData) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString *objString = [weakSelf.sanitizer parameterToString:obj]; + NSString *objString = [sanitizer parameterToString:obj]; NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; [formData appendPartWithFormData:data name:key]; }]; @@ -318,76 +198,73 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSURL *filePath = (NSURL *)obj; [formData appendPartWithFileURL:filePath name:key error:nil]; }]; - } error:nil]; + } error:&requestCreateError]; } else { if (formParams) { - request = [self.requestSerializer requestWithMethod:method - URLString:urlString - parameters:formParams - error:nil]; + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; } if (body) { - request = [self.requestSerializer requestWithMethod:method - URLString:urlString - parameters:body - error:nil]; + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; } } - - // request cache - BOOL hasHeaderParams = [headerParams count] > 0; - if (offlineState) { - SWGDebugLog(@"%@ cache forced", resourcePath); - [request setCachePolicy:NSURLRequestReturnCacheDataDontLoad]; - } - else if(!hasHeaderParams && [method isEqualToString:@"GET"] && cacheEnabled) { - SWGDebugLog(@"%@ cache enabled", resourcePath); - [request setCachePolicy:NSURLRequestUseProtocolCachePolicy]; - } - else { - SWGDebugLog(@"%@ cache disabled", resourcePath); - [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; + if(!request) { + completionBlock(nil, requestCreateError); + return nil; } - if (hasHeaderParams){ + if ([headerParams count] > 0){ for(NSString * key in [headerParams keyEnumerator]){ [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; } } - [self.requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; [self postProcessRequest:request]; - NSNumber* requestId = [SWGApiClient queueRequest]; - if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) { - [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { completionBlock(data, error); }]; - } - else { - [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { NSError * serializationError; - id response = [self.responseDeserializer deserialize:data class:responseType error:&serializationError]; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + if(!response && !error){ error = serializationError; } completionBlock(response, error); }]; } - return requestId; + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; } //Added for easier override to modify request -(void)postProcessRequest:(NSMutableURLRequest *)request { - // Always disable cookies! - [request setHTTPShouldHandleCookies:NO]; + } #pragma mark - -- (NSString*) pathWithQueryParamsToString:(NSString*) path - queryParams:(NSDictionary*) queryParams { +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { if(queryParams.count == 0) { return path; } @@ -445,9 +322,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { /** * Update header and query params based on authentication settings */ -- (void) updateHeaderParams:(NSDictionary *__autoreleasing *)headers - queryParams:(NSDictionary *__autoreleasing *)querys - WithAuthSettings:(NSArray *)authSettings { +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)querys WithAuthSettings:(NSArray *)authSettings { if ([authSettings count] == 0) { return; @@ -456,9 +331,10 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - NSDictionary* configurationAuthSettings = [[self configuration] authSettings]; + id config = self.configuration; for (NSString *auth in authSettings) { - NSDictionary *authSetting = configurationAuthSettings[auth]; + NSDictionary *authSetting = config.authSettings[auth]; + if(!authSetting) { // auth setting is set only if the key is non-empty continue; } @@ -476,14 +352,14 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; } -- (AFSecurityPolicy *) customSecurityPolicy { +- (AFSecurityPolicy *) createSecurityPolicy { AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - SWGConfiguration *config = [self configuration]; + id config = self.configuration; if (config.sslCaCert) { NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:@[certData]]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; } if (config.verifySSL) { @@ -497,8 +373,4 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { return securityPolicy; } -- (SWGConfiguration*) configuration { - return [SWGConfiguration sharedConfig]; -} - @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h index b1bbd4bc7f6..a22ceb78391 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h @@ -1,182 +1,89 @@ #import -#import "SWGApiClient.h" -#import "SWGLogger.h" + +@class SWGLogger; /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ -@class SWGApiClient; -@interface SWGConfiguration : NSObject +static NSString * const kSWGAPIVersion = @"1.0.0"; + +@protocol SWGConfiguration /** - * Default api logger + * Api logger */ -@property (nonatomic, strong) SWGLogger * logger; +@property (readonly, nonatomic) SWGLogger *logger; /** - * Default api client + * Base url */ -@property (nonatomic) SWGApiClient *apiClient; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; +@property (readonly, nonatomic) NSString *host; /** * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; +@property (readonly, nonatomic) NSDictionary *apiKey; /** * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; /** * Username for HTTP Basic Authentication */ - @property (nonatomic) NSString *username; +@property (readonly, nonatomic) NSString *username; /** * Password for HTTP Basic Authentication */ -@property (nonatomic) NSString *password; +@property (readonly, nonatomic) NSString *password; /** * Access token for OAuth */ -@property (nonatomic) NSString *accessToken; +@property (readonly, nonatomic) NSString *accessToken; /** * Temp folder for file download */ -@property (nonatomic) NSString *tempFolderPath; +@property (readonly, nonatomic) NSString *tempFolderPath; /** * Debug switch, default false */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; +@property (readonly, nonatomic) BOOL debug; /** * SSL/TLS verification * Set this to NO to skip verifying SSL certificate when calling API from https server */ -@property (nonatomic) BOOL verifySSL; +@property (readonly, nonatomic) BOOL verifySSL; /** * SSL/TLS verification * Set this to customize the certificate file to verify the peer */ -@property (nonatomic) NSString *sslCaCert; +@property (readonly, nonatomic) NSString *sslCaCert; /** - * Sets API key - * - * To remove a apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * + * Authentication Settings */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param apiKeyPrefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; +@property (readonly, nonatomic) NSDictionary *authSettings; /** * Default headers for all services */ @property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; -/** -* Removes header from defaultHeaders -* -* @param Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end +@end \ No newline at end of file diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h index dbfe377577e..1435ac50c25 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -2,28 +2,17 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGJSONRequestSerializer : AFJSONRequestSerializer @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h index ecf02f24322..f4ab3b37e4c 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + #ifndef SWGDebugLogResponse #define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; #endif diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m index 322ae9678d7..2a96e5ec54d 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m @@ -17,8 +17,7 @@ #pragma mark - Log Methods -- (void)debugLog:(NSString *)method - message:(NSString *)format, ... { +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { if (!self.isEnabled) { return; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h index 51443974b74..9d6d48886ef 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h @@ -2,29 +2,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGObject : JSONModel @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m index 8085c404f7e..db970d34669 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m @@ -2,6 +2,35 @@ @implementation SWGObject +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + /** * Gets the string presentation of the object. * This method will be called when logging model object using `NSLog`. diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h index ec702737c97..06830d5aede 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGQueryParamCollection : NSObject @property(nonatomic, readonly) NSArray* values; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m index 83303045185..9aa8a091762 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m @@ -5,11 +5,15 @@ @synthesize values = _values; @synthesize format = _format; -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format { - _values = values; - _format = format; +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + self = [super init]; + if (self) { + _values = values; + _format = format; + } + return self; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h index c9fa7e99f1d..68ea1b720f8 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + /** * A key for deserialization ErrorDomain */ @@ -50,7 +39,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; * Deserializes the given data to Objective-C object. * * @param data The data will be deserialized. - * @param class The type of objective-c object. + * @param className The type of objective-c object. * @param error The error */ - (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m index 6ac9f75e818..46d4b460fc7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m @@ -16,6 +16,7 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; @property (nonatomic, strong) NSNumberFormatter* numberFormatter; @property (nonatomic, strong) NSArray *primitiveTypes; @property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; @property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; @property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; @@ -33,7 +34,9 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; formatter.numberStyle = NSNumberFormatterDecimalStyle; _numberFormatter = formatter; _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; - _basicReturnTypes = @[@"NSObject", @"id", @"NSData"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" options:NSRegularExpressionCaseInsensitive error:nil]; @@ -53,23 +56,36 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; #pragma mark - Deserialize methods - (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { - // return nil if data is nil or className is nil - if (!data || !className || [data isKindOfClass:[NSNull class]]) { + if (!data || !className) { return nil; } - // remove "*" from className, if ends with "*" if ([className hasSuffix:@"*"]) { className = [className substringToIndex:[className length] - 1]; } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + // pure object if ([self.basicReturnTypes containsObject:className]) { - return data; + return jsonData; } // primitives if ([self.primitiveTypes containsObject:className]) { - return [self deserializePrimitiveValue:data class:className error:error]; + return [self deserializePrimitiveValue:jsonData class:className error:error]; } NSTextCheckingResult *match = nil; @@ -78,37 +94,37 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:data innerType:innerType error:error]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; } // list of primitives match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:data innerType:innerType error:error]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; } // map match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:data valueType:valueType error:error]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; } match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:data valueType:valueType error:error]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; } // model Class ModelClass = NSClassFromString(className); if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [(JSONModel *) [ModelClass alloc] initWithDictionary:data error:error]; + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; } if(error) { - *error = [self unknownResponseErrorWithExpectedType:className data:data]; + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; } return nil; } @@ -172,7 +188,7 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; - (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { if ([className isEqualToString:@"NSString"]) { - return [NSString stringWithString:data]; + return [NSString stringWithFormat:@"%@",data]; } else if ([className isEqualToString:@"NSDate"]) { return [self deserializeDateValue:data error:error]; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h index f968b13c885..1ede89f6035 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h @@ -1,31 +1,22 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + extern NSString * SWGPercentEscapedStringFromString(NSString *string); +extern NSString * const kSWGApplicationJSONType; + @protocol SWGSanitizer /** diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m index a74f72afbe3..49ff6ed014a 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m @@ -3,6 +3,8 @@ #import "SWGQueryParamCollection.h" #import +NSString * const kSWGApplicationJSONType = @"application/json"; + NSString * SWGPercentEscapedStringFromString(NSString *string) { static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; @@ -43,8 +45,6 @@ NSString * SWGPercentEscapedStringFromString(NSString *string) { @implementation SWGSanitizer -static NSString * kApplicationJSONType = @"application/json"; - -(instancetype)init { self = [super init]; if ( !self ) { @@ -141,7 +141,7 @@ static NSString * kApplicationJSONType = @"application/json"; NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; for (NSString *string in accepts) { if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { - return kApplicationJSONType; + return kSWGApplicationJSONType; } [lowerAccepts addObject:[string lowercaseString]]; } @@ -153,12 +153,12 @@ static NSString * kApplicationJSONType = @"application/json"; */ - (NSString *) selectHeaderContentType:(NSArray *)contentTypes { if (contentTypes.count == 0) { - return kApplicationJSONType; + return kSWGApplicationJSONType; } NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; for (NSString *string in contentTypes) { if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ - return kApplicationJSONType; + return kSWGApplicationJSONType; } [lowerContentTypes addObject:[string lowercaseString]]; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h index d05ae2fc866..ee9a261859e 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h @@ -2,37 +2,26 @@ #import "SWGObject.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @protocol SWGReturn @end @interface SWGReturn : SWGObject -/* property description *_/ ' \" =end \\r\\n \\n \\r [optional] +/* property description *_/ ' \" =end -- \\r\\n \\n \\r [optional] */ @property(nonatomic) NSNumber* _return; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m index 90ad222590a..1858e6b9930 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"return": @"_return" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_return": @"return" }]; } /** diff --git a/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md b/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md index 76c62cd4fbf..aff9984217a 100644 --- a/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md +++ b/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md @@ -1,28 +1,28 @@ # SWGFakeApi -All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r* +All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testCodeInjectEndRnNR**](SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r +[**testCodeInjectEndRnNR**](SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r # **testCodeInjectEndRnNR** ```objc --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler; ``` -To test code injection *_/ ' \" =end \\r\\n \\n \\r +To test code injection *_/ ' \" =end -- \\r\\n \\n \\r ### Example ```objc -NSString* testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +NSString* testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) SWGFakeApi*apiInstance = [[SWGFakeApi alloc] init]; -// To test code injection *_/ ' \" =end \\r\\n \\n \\r +// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r [apiInstance testCodeInjectEndRnNRWithTestCodeInjectEndRnNR:testCodeInjectEndRnNR completionHandler: ^(NSError* error) { if (error) { @@ -35,7 +35,7 @@ SWGFakeApi*apiInstance = [[SWGFakeApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **testCodeInjectEndRnNR** | **NSString***| To test code injection *_/ ' \" =end \\r\\n \\n \\r | [optional] + **testCodeInjectEndRnNR** | **NSString***| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | [optional] ### Return type @@ -47,12 +47,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json, */ ' =end - - - - **Accept**: application/json, */ ' =end - - + - **Content-Type**: application/json, *_/ ' =end -- + - **Accept**: application/json, *_/ ' =end -- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore-security-test/objc/docs/SWGReturn.md b/samples/client/petstore-security-test/objc/docs/SWGReturn.md index fc4fc036c84..a604021dd6e 100644 --- a/samples/client/petstore-security-test/objc/docs/SWGReturn.md +++ b/samples/client/petstore-security-test/objc/docs/SWGReturn.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_return** | **NSNumber*** | property description *_/ ' \" =end \\r\\n \\n \\r | [optional] +**_return** | **NSNumber*** | property description *_/ ' \" =end -- \\r\\n \\n \\r | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index dc09ad22254..aca3b5b6e33 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -6,8 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-08-23T10:56:26.470+02:00 -- Build package: class io.swagger.codegen.languages.ObjcClientCodegen +- Build package: io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -56,7 +55,7 @@ Import the following: ## Recommendation -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue. +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. ## Getting Started @@ -124,6 +123,12 @@ Class | Method | HTTP request | Description ## Documentation For Authorization +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## petstore_auth - **Type**: OAuth @@ -133,12 +138,6 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## Author diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec index 32d8e336da7..e43cdfd5a09 100644 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.framework = 'SystemConfiguration' s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.license = "Apache License, Version 2.0" + s.license = "Proprietary" s.source = { :git => "https://github.com/swagger-api/swagger-codegen.git", :tag => "#{s.version}" } s.author = { "Swagger" => "apiteam@swagger.io" } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index ade955b27f8..74ba6e6b482 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGPetApi: NSObject extern NSString* kSWGPetApiErrorDomain; @@ -61,7 +50,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by status -/// Multiple status values can be provided with comma seperated strings +/// Multiple status values can be provided with comma separated strings /// /// @param status Status values that need to be considered for filter (optional) (default to available) /// @@ -74,7 +63,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by tags -/// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// @param tags Tags to filter by (optional) /// diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index 0034dd69fc5..c0ca97c3480 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -186,7 +186,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status -/// Multiple status values can be provided with comma seperated strings +/// Multiple status values can be provided with comma separated strings /// @param status Status values that need to be considered for filter (optional, default to available) /// /// @returns NSArray* @@ -247,7 +247,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags -/// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// @param tags Tags to filter by (optional) /// /// @returns NSArray* diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index 92aeefb176e..6cfc765cd0b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGStoreApi: NSObject extern NSString* kSWGStoreApiErrorDomain; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 2c35bdcb7b0..9695c16918b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGUserApi: NSObject extern NSString* kSWGUserApiErrorDomain; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index cec2428f4b9..4edede07524 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -13,20 +13,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + /** * A key for `NSError` user info dictionaries. * diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m index f757e139d0e..4b1d014d2bc 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m @@ -89,7 +89,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { #pragma mark - Task Methods - (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); if(!error) { @@ -104,7 +104,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - + return task; } @@ -135,7 +135,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - + return task; } @@ -222,7 +222,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self postProcessRequest:request]; - + NSURLSessionTask *task = nil; if ([self.downloadTaskResponseTypes containsObject:responseType]) { @@ -241,9 +241,9 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(response, error); }]; } - + [task resume]; - + return task; } @@ -330,7 +330,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - + id config = self.configuration; for (NSString *auth in authSettings) { NSDictionary *authSetting = config.authSettings[auth]; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index 864d87d2535..c5b0d2dbbe4 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -12,20 +12,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + static NSString * const kSWGAPIVersion = @"1.0.0"; @protocol SWGConfiguration diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index 48cedd5d558..d3e02965656 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -11,20 +11,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @class SWGApiClient; @interface SWGDefaultConfiguration : NSObject @@ -117,7 +106,7 @@ /** * Sets the prefix for API key * - * @param apiKeyPrefix API key prefix. + * @param prefix API key prefix. * @param identifier API key identifier. */ - (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; @@ -157,7 +146,7 @@ /** * Removes header from defaultHeaders * -* @param Header name. +* @param key Header name. */ -(void) removeDefaultHeaderForKey:(NSString*)key; @@ -170,7 +159,7 @@ -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; /** -* @param Header key name. +* @param key Header key name. */ -(NSString*) defaultHeaderForKey:(NSString*)key; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m index 705580e9a54..4afe43359aa 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -104,13 +104,6 @@ - (NSDictionary *) authSettings { return @{ - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, @"api_key": @{ @"type": @"api_key", @@ -118,6 +111,13 @@ @"key": @"api_key", @"value": [self getApiKeyWithPrefix:@"api_key"] }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, }; } From 9516c81ebb6d35bb7b48d8263938217bd4f247b0 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Fri, 3 Mar 2017 12:20:52 +0200 Subject: [PATCH 054/132] [JavaScript] Added *WithHttpInfo methods in 'usePromises' mode to provide a way to get access to HTTP response object (e.g. headers or status code) (#3654) (#4902) --- .../resources/Javascript/ApiClient.mustache | 2 +- .../main/resources/Javascript/api.mustache | 26 ++- .../javascript-promise/src/ApiClient.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 83 +++++++-- .../javascript-promise/src/api/PetApi.js | 160 +++++++++++++++--- .../javascript-promise/src/api/StoreApi.js | 73 ++++++-- .../javascript-promise/src/api/UserApi.js | 155 ++++++++++++++--- .../petstore/javascript/src/api/FakeApi.js | 10 +- .../petstore/javascript/src/api/PetApi.js | 16 +- .../petstore/javascript/src/api/StoreApi.js | 6 +- .../petstore/javascript/src/api/UserApi.js | 18 +- 11 files changed, 450 insertions(+), 101 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index 8a80d0d80b2..8f49b13a4c8 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -412,7 +412,7 @@ } else { try { var data = _this.deserialize(response, returnType); - resolve(data); + resolve({data, response}); } catch (err) { reject(err); } diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache index e3990ed910a..b012bfe458c 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache @@ -50,14 +50,14 @@ * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> - * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response<^returnType>, with an object containing HTTP response */ - this. = function() {<#hasOptionalParams> + this.<#usePromises>WithHttpInfo = function() {<#hasOptionalParams> opts = opts || {}; var postBody = <#bodyParam><#required><^required>opts['']<^bodyParam>null; <#allParams><#required> // verify the required parameter '' is set - if ( == undefined || == null) { + if ( === undefined || === null) { throw new Error("Missing the required parameter '' when calling "); } @@ -86,6 +86,26 @@ authNames, contentTypes, accepts, returnType<^usePromises>, callback ); } +<#usePromises> + <#emitJSDoc> + + /**<#summary> + * <#notes> + * <#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * @param {Object} opts Optional parameters<#allParams><^required> + * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> + * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} + */ + this. = function() { + return this.WithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 3f735978306..6a64ce46bc7 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -406,7 +406,7 @@ } else { try { var data = _this.deserialize(response, returnType); - resolve(data); + resolve({data, response}); } catch (err) { reject(err); } diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 623fb1d191e..30f48949f2a 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -50,13 +50,13 @@ * To test \"client\" model * To test \"client\" model * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ - this.testClientModel = function(body) { + this.testClientModelWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -82,6 +82,19 @@ ); } + /** + * To test \"client\" model + * To test \"client\" model + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testClientModel = function(body) { + return this.testClientModelWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -101,29 +114,29 @@ * @param {Date} opts.dateTime None * @param {String} opts.password None * @param {String} opts.callback None - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + this.testEndpointParametersWithHttpInfo = function(_number, _double, patternWithoutDelimiter, _byte, opts) { opts = opts || {}; var postBody = null; // verify the required parameter '_number' is set - if (_number == undefined || _number == null) { + if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set - if (_double == undefined || _double == null) { + if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { + if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set - if (_byte == undefined || _byte == null) { + if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } @@ -163,6 +176,33 @@ ); } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param {Number} _number None + * @param {Number} _double None + * @param {String} patternWithoutDelimiter None + * @param {String} _byte None + * @param {Object} opts Optional parameters + * @param {Number} opts.integer None + * @param {Number} opts.int32 None + * @param {Number} opts.int64 None + * @param {Number} opts._float None + * @param {String} opts._string None + * @param {String} opts.binary None + * @param {Date} opts._date None + * @param {Date} opts.dateTime None + * @param {String} opts.password None + * @param {String} opts.callback None + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + return this.testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * To test enum parameters @@ -176,9 +216,9 @@ * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg) * @param {Number} opts.enumQueryInteger Query parameter enum test (double) * @param {Number} opts.enumQueryDouble Query parameter enum test (double) - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEnumParameters = function(opts) { + this.testEnumParametersWithHttpInfo = function(opts) { opts = opts || {}; var postBody = null; @@ -211,6 +251,27 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * To test enum parameters + * To test enum parameters + * @param {Object} opts Optional parameters + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg) + * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg) + * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg) + * @param {Number} opts.enumQueryInteger Query parameter enum test (double) + * @param {Number} opts.enumQueryDouble Query parameter enum test (double) + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testEnumParameters = function(opts) { + return this.testEnumParametersWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index cb7005107ab..c0e068ace26 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -50,13 +50,13 @@ * Add a new pet to the store * * @param {module:model/Pet} body Pet object that needs to be added to the store - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.addPet = function(body) { + this.addPetWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -82,6 +82,19 @@ ); } + /** + * Add a new pet to the store + * + * @param {module:model/Pet} body Pet object that needs to be added to the store + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.addPet = function(body) { + return this.addPetWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Deletes a pet @@ -89,14 +102,14 @@ * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters * @param {String} opts.apiKey - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deletePet = function(petId, opts) { + this.deletePetWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -124,18 +137,33 @@ ); } + /** + * Deletes a pet + * + * @param {Number} petId Pet id to delete + * @param {Object} opts Optional parameters + * @param {String} opts.apiKey + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deletePet = function(petId, opts) { + return this.deletePetWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param {Array.} status Status values that need to be considered for filter - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByStatus = function(status) { + this.findPetsByStatusWithHttpInfo = function(status) { var postBody = null; // verify the required parameter 'status' is set - if (status == undefined || status == null) { + if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -162,18 +190,31 @@ ); } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param {Array.} status Status values that need to be considered for filter + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + */ + this.findPetsByStatus = function(status) { + return this.findPetsByStatusWithHttpInfo(status) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param {Array.} tags Tags to filter by - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByTags = function(tags) { + this.findPetsByTagsWithHttpInfo = function(tags) { var postBody = null; // verify the required parameter 'tags' is set - if (tags == undefined || tags == null) { + if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -200,18 +241,31 @@ ); } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param {Array.} tags Tags to filter by + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + */ + this.findPetsByTags = function(tags) { + return this.findPetsByTagsWithHttpInfo(tags) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Find pet by ID * Returns a single pet * @param {Number} petId ID of pet to return - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Pet} and HTTP response */ - this.getPetById = function(petId) { + this.getPetByIdWithHttpInfo = function(petId) { var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -238,18 +292,31 @@ ); } + /** + * Find pet by ID + * Returns a single pet + * @param {Number} petId ID of pet to return + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet} + */ + this.getPetById = function(petId) { + return this.getPetByIdWithHttpInfo(petId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Update an existing pet * * @param {module:model/Pet} body Pet object that needs to be added to the store - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePet = function(body) { + this.updatePetWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -275,6 +342,19 @@ ); } + /** + * Update an existing pet + * + * @param {module:model/Pet} body Pet object that needs to be added to the store + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updatePet = function(body) { + return this.updatePetWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Updates a pet in the store with form data @@ -283,14 +363,14 @@ * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet * @param {String} opts.status Updated status of the pet - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePetWithForm = function(petId, opts) { + this.updatePetWithFormWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -319,6 +399,22 @@ ); } + /** + * Updates a pet in the store with form data + * + * @param {Number} petId ID of pet that needs to be updated + * @param {Object} opts Optional parameters + * @param {String} opts.name Updated name of the pet + * @param {String} opts.status Updated status of the pet + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updatePetWithForm = function(petId, opts) { + return this.updatePetWithFormWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * uploads an image @@ -327,14 +423,14 @@ * @param {Object} opts Optional parameters * @param {String} opts.additionalMetadata Additional data to pass to server * @param {File} opts.file file to upload - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response */ - this.uploadFile = function(petId, opts) { + this.uploadFileWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } @@ -362,6 +458,22 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * uploads an image + * + * @param {Number} petId ID of pet to update + * @param {Object} opts Optional parameters + * @param {String} opts.additionalMetadata Additional data to pass to server + * @param {File} opts.file file to upload + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse} + */ + this.uploadFile = function(petId, opts) { + return this.uploadFileWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index b6522842577..987f5c0bdb2 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -50,13 +50,13 @@ * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteOrder = function(orderId) { + this.deleteOrderWithHttpInfo = function(orderId) { var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -83,13 +83,26 @@ ); } + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param {String} orderId ID of the order that needs to be deleted + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deleteOrder = function(orderId) { + return this.deleteOrderWithHttpInfo(orderId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object.} and HTTP response */ - this.getInventory = function() { + this.getInventoryWithHttpInfo = function() { var postBody = null; @@ -114,18 +127,30 @@ ); } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.} + */ + this.getInventory = function() { + return this.getInventoryWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.getOrderById = function(orderId) { + this.getOrderByIdWithHttpInfo = function(orderId) { var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -152,18 +177,31 @@ ); } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param {Number} orderId ID of pet that needs to be fetched + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + */ + this.getOrderById = function(orderId) { + return this.getOrderByIdWithHttpInfo(orderId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Place an order for a pet * * @param {module:model/Order} body order placed for purchasing the pet - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.placeOrder = function(body) { + this.placeOrderWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } @@ -188,6 +226,19 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * Place an order for a pet + * + * @param {module:model/Order} body order placed for purchasing the pet + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + */ + this.placeOrder = function(body) { + return this.placeOrderWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index db2af27a908..c36b5186a19 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -50,13 +50,13 @@ * Create user * This can only be done by the logged in user. * @param {module:model/User} body Created user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUser = function(body) { + this.createUserWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -82,18 +82,31 @@ ); } + /** + * Create user + * This can only be done by the logged in user. + * @param {module:model/User} body Created user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.createUser = function(body) { + return this.createUserWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Creates list of users with given input array * * @param {Array.} body List of user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUsersWithArrayInput = function(body) { + this.createUsersWithArrayInputWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -119,18 +132,31 @@ ); } - /** * Creates list of users with given input array * * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.createUsersWithListInput = function(body) { + this.createUsersWithArrayInput = function(body) { + return this.createUsersWithArrayInputWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Creates list of users with given input array + * + * @param {Array.} body List of user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + this.createUsersWithListInputWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -156,18 +182,31 @@ ); } + /** + * Creates list of users with given input array + * + * @param {Array.} body List of user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.createUsersWithListInput = function(body) { + return this.createUsersWithListInputWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Delete user * This can only be done by the logged in user. * @param {String} username The name that needs to be deleted - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteUser = function(username) { + this.deleteUserWithHttpInfo = function(username) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -194,18 +233,31 @@ ); } + /** + * Delete user + * This can only be done by the logged in user. + * @param {String} username The name that needs to be deleted + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deleteUser = function(username) { + return this.deleteUserWithHttpInfo(username) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Get user by user name * * @param {String} username The name that needs to be fetched. Use user1 for testing. - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response */ - this.getUserByName = function(username) { + this.getUserByNameWithHttpInfo = function(username) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -232,24 +284,37 @@ ); } + /** + * Get user by user name + * + * @param {String} username The name that needs to be fetched. Use user1 for testing. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} + */ + this.getUserByName = function(username) { + return this.getUserByNameWithHttpInfo(username) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Logs user into the system * * @param {String} username The user name for login * @param {String} password The password for login in clear text - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link 'String'} and HTTP response */ - this.loginUser = function(username, password) { + this.loginUserWithHttpInfo = function(username, password) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set - if (password == undefined || password == null) { + if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -277,13 +342,27 @@ ); } + /** + * Logs user into the system + * + * @param {String} username The user name for login + * @param {String} password The password for login in clear text + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'} + */ + this.loginUser = function(username, password) { + return this.loginUserWithHttpInfo(username, password) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Logs out current logged in user session * - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.logoutUser = function() { + this.logoutUserWithHttpInfo = function() { var postBody = null; @@ -308,24 +387,36 @@ ); } + /** + * Logs out current logged in user session + * + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.logoutUser = function() { + return this.logoutUserWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Updated user * This can only be done by the logged in user. * @param {String} username name that need to be deleted * @param {module:model/User} body Updated user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updateUser = function(username, body) { + this.updateUserWithHttpInfo = function(username, body) { var postBody = body; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } @@ -351,6 +442,20 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * Updated user + * This can only be done by the logged in user. + * @param {String} username name that need to be deleted + * @param {module:model/User} body Updated user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updateUser = function(username, body) { + return this.updateUserWithHttpInfo(username, body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index c9f0fbdbf03..9a64ccfc0a6 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -64,7 +64,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -123,22 +123,22 @@ var postBody = null; // verify the required parameter '_number' is set - if (_number == undefined || _number == null) { + if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set - if (_double == undefined || _double == null) { + if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { + if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set - if (_byte == undefined || _byte == null) { + if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 16203fcb4bc..4944965b39c 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -63,7 +63,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -110,7 +110,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -157,7 +157,7 @@ var postBody = null; // verify the required parameter 'status' is set - if (status == undefined || status == null) { + if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -203,7 +203,7 @@ var postBody = null; // verify the required parameter 'tags' is set - if (tags == undefined || tags == null) { + if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -249,7 +249,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -294,7 +294,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -342,7 +342,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -394,7 +394,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 7219f4db4ec..36cc93dc021 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -63,7 +63,7 @@ var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -148,7 +148,7 @@ var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -194,7 +194,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 76d3768deac..6264689ca15 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -63,7 +63,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -107,7 +107,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -151,7 +151,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -195,7 +195,7 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -241,7 +241,7 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -288,12 +288,12 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set - if (password == undefined || password == null) { + if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -378,12 +378,12 @@ var postBody = body; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } From 30c2b6f2623ce8c245b8a8867c3d9a463d039d01 Mon Sep 17 00:00:00 2001 From: Bart Kummel Date: Fri, 3 Mar 2017 11:38:19 +0100 Subject: [PATCH 055/132] Improved ExampleGenerator (#4797) * Improved ExampleGenerator: - Now takes into account enum and uri/url formats for strings. - Uses example for referenced objects if available. - Proper examples get generated for specific numeric formats, because more specific formats now get checked before generic format. - Honors min and max values for numerical properties, if set. * Ran script `bin/nodejs-petstore-server.sh`. * Renamed log to logger to conform to coding standard. --- .../codegen/examples/ExampleGenerator.java | 128 +++++++++++++----- .../server/petstore/nodejs/api/swagger.yaml | 8 +- .../petstore/nodejs/controllers/PetService.js | 72 +++++----- .../nodejs/controllers/StoreService.js | 26 ++-- .../nodejs/controllers/UserService.js | 14 +- 5 files changed, 157 insertions(+), 91 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java index bff78820b25..08a04769e87 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java @@ -1,5 +1,8 @@ package io.swagger.codegen.examples; +import static io.swagger.models.properties.StringProperty.Format.URI; +import static io.swagger.models.properties.StringProperty.Format.URL; + import io.swagger.models.Model; import io.swagger.models.ModelImpl; import io.swagger.models.properties.ArrayProperty; @@ -11,7 +14,6 @@ import io.swagger.models.properties.DecimalProperty; import io.swagger.models.properties.DoubleProperty; import io.swagger.models.properties.FileProperty; import io.swagger.models.properties.FloatProperty; -import io.swagger.models.properties.IntegerProperty; import io.swagger.models.properties.LongProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.ObjectProperty; @@ -20,10 +22,12 @@ import io.swagger.models.properties.RefProperty; import io.swagger.models.properties.StringProperty; import io.swagger.models.properties.UUIDProperty; import io.swagger.util.Json; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -31,6 +35,17 @@ import java.util.Map; import java.util.Set; public class ExampleGenerator { + private static final Logger logger = LoggerFactory.getLogger(ExampleGenerator.class); + + // TODO: move constants to more appropriate location + private static final String MIME_TYPE_JSON = "application/json"; + private static final String MIME_TYPE_XML = "application/xml"; + + private static final String EXAMPLE = "example"; + private static final String CONTENT_TYPE = "contentType"; + private static final String OUTPUT = "output"; + private static final String NONE = "none"; + protected Map examples; public ExampleGenerator(Map examples) { @@ -38,53 +53,76 @@ public class ExampleGenerator { } public List> generate(Map examples, List mediaTypes, Property property) { - List> output = new ArrayList>(); - Set processedModels = new HashSet(); + List> output = new ArrayList<>(); + Set processedModels = new HashSet<>(); if (examples == null) { if (mediaTypes == null) { // assume application/json for this - mediaTypes = Arrays.asList("application/json"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + mediaTypes = Collections.singletonList(MIME_TYPE_JSON); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. } for (String mediaType : mediaTypes) { - Map kv = new HashMap(); - kv.put("contentType", mediaType); - if (property != null && mediaType.startsWith("application/json")) { + Map kv = new HashMap<>(); + kv.put(CONTENT_TYPE, mediaType); + if (property != null && mediaType.startsWith(MIME_TYPE_JSON)) { String example = Json.pretty(resolvePropertyToExample(mediaType, property, processedModels)); if (example != null) { - kv.put("example", example); + kv.put(EXAMPLE, example); output.add(kv); } - } else if (property != null && mediaType.startsWith("application/xml")) { + } else if (property != null && mediaType.startsWith(MIME_TYPE_XML)) { String example = new XmlExampleGenerator(this.examples).toXml(property); if (example != null) { - kv.put("example", example); + kv.put(EXAMPLE, example); output.add(kv); } } } } else { for (Map.Entry entry : examples.entrySet()) { - final Map kv = new HashMap(); - kv.put("contentType", entry.getKey()); - kv.put("example", Json.pretty(entry.getValue())); + final Map kv = new HashMap<>(); + kv.put(CONTENT_TYPE, entry.getKey()); + kv.put(EXAMPLE, Json.pretty(entry.getValue())); output.add(kv); } } if (output.size() == 0) { - Map kv = new HashMap(); - kv.put("output", "none"); + Map kv = new HashMap<>(); + kv.put(OUTPUT, NONE); output.add(kv); } return output; } - protected Object resolvePropertyToExample(String mediaType, Property property, Set processedModels) { + private Object resolvePropertyToExample(String mediaType, Property property, Set processedModels) { + logger.debug("Resolving example for property {}...", property); if (property.getExample() != null) { + logger.debug("Example set in swagger spec, returning example: '{}'", property.getExample().toString()); return property.getExample(); } else if (property instanceof StringProperty) { + logger.debug("String property"); + String defaultValue = ((StringProperty) property).getDefault(); + if (defaultValue != null && !defaultValue.isEmpty()) { + logger.debug("Default value found: '{}'", defaultValue); + return defaultValue; + } + List enumValues = ((StringProperty) property).getEnum(); + if (enumValues != null && !enumValues.isEmpty()) { + logger.debug("Enum value found: '{}'", enumValues.get(0)); + return enumValues.get(0); + } + String format = property.getFormat(); + if (format != null && (URI.getName().equals(format) || URL.getName().equals(format))) { + logger.debug("URI or URL format, without default or enum, generating random one."); + return "http://example.com/aeiou"; + } + logger.debug("No values found, using default string 'aeiou' as example"); return "aeiou"; } else if (property instanceof BooleanProperty) { + Boolean defaultValue = ((BooleanProperty) property).getDefault(); + if (defaultValue != null) { + return defaultValue; + } return Boolean.TRUE; } else if (property instanceof ArrayProperty) { Property innerType = ((ArrayProperty) property).getItems(); @@ -97,21 +135,28 @@ public class ExampleGenerator { return "2000-01-23"; } else if (property instanceof DateTimeProperty) { return "2000-01-23T04:56:07.000+00:00"; - } else if (property instanceof DecimalProperty) { - return new BigDecimal(1.3579); } else if (property instanceof DoubleProperty) { - return 3.149; + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return randomNumber(min, max); + } else if (property instanceof FloatProperty) { + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return (float) randomNumber(min, max); + } else if (property instanceof DecimalProperty) { + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return new BigDecimal(randomNumber(min, max)); } else if (property instanceof FileProperty) { return ""; // TODO - } else if (property instanceof FloatProperty) { - return 1.23f; - } else if (property instanceof IntegerProperty) { - return 123; } else if (property instanceof LongProperty) { - return 123456789L; - // Properties that are not Integer or Long may still be BaseInteger - } else if (property instanceof BaseIntegerProperty) { - return 123; + Double min = ((BaseIntegerProperty) property).getMinimum() == null ? null : ((BaseIntegerProperty) property).getMinimum().doubleValue(); + Double max = ((BaseIntegerProperty) property).getMaximum() == null ? null : ((BaseIntegerProperty) property).getMaximum().doubleValue(); + return (long) randomNumber(min, max); + } else if (property instanceof BaseIntegerProperty) { // Includes IntegerProperty + Double min = ((BaseIntegerProperty) property).getMinimum() == null ? null : ((BaseIntegerProperty) property).getMinimum().doubleValue(); + Double max = ((BaseIntegerProperty) property).getMaximum() == null ? null : ((BaseIntegerProperty) property).getMaximum().doubleValue(); + return (int) randomNumber(min, max); } else if (property instanceof MapProperty) { Map mp = new HashMap(); if (property.getName() != null) { @@ -126,10 +171,12 @@ public class ExampleGenerator { return "{}"; } else if (property instanceof RefProperty) { String simpleName = ((RefProperty) property).getSimpleRef(); + logger.debug("Ref property, simple name: {}", simpleName); Model model = examples.get(simpleName); if (model != null) { return resolveModelToExample(simpleName, mediaType, model, processedModels); } + logger.warn("Ref property with empty model."); } else if (property instanceof UUIDProperty) { return "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; } @@ -137,16 +184,35 @@ public class ExampleGenerator { return ""; } - public Object resolveModelToExample(String name, String mediaType, Model model, Set processedModels) { + private double randomNumber(Double min, Double max) { + if (min != null && max != null) { + double range = max - min; + return Math.random() * range + min; + } else if (min != null) { + return Math.random() + min; + } else if (max != null) { + return Math.random() * max; + } else { + return Math.random() * 10; + } + } + + private Object resolveModelToExample(String name, String mediaType, Model model, Set processedModels) { if (processedModels.contains(name)) { return ""; } if (model instanceof ModelImpl) { processedModels.add(name); ModelImpl impl = (ModelImpl) model; - Map values = new HashMap(); + Map values = new HashMap<>(); - if (impl.getProperties() != null) { + logger.debug("Resolving model '{}' to example", name); + + if (impl.getExample() != null) { + logger.debug("Using example from spec: {}", impl.getExample()); + return impl.getExample(); + } else if (impl.getProperties() != null) { + logger.debug("Creating example from model values"); for (String propertyName : impl.getProperties().keySet()) { Property property = impl.getProperties().get(propertyName); values.put(propertyName, resolvePropertyToExample(mediaType, property, processedModels)); diff --git a/samples/server/petstore/nodejs/api/swagger.yaml b/samples/server/petstore/nodejs/api/swagger.yaml index 64049d2fdcc..3be49fdd5f2 100644 --- a/samples/server/petstore/nodejs/api/swagger.yaml +++ b/samples/server/petstore/nodejs/api/swagger.yaml @@ -586,10 +586,6 @@ paths: description: "User not found" x-swagger-router-controller: "User" securityDefinitions: - api_key: - type: "apiKey" - name: "api_key" - in: "header" petstore_auth: type: "oauth2" authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" @@ -597,6 +593,10 @@ securityDefinitions: scopes: write:pets: "modify pets in your account" read:pets: "read your pets" + api_key: + type: "apiKey" + name: "api_key" + in: "header" definitions: Order: type: "object" diff --git a/samples/server/petstore/nodejs/controllers/PetService.js b/samples/server/petstore/nodejs/controllers/PetService.js index 8a4235a35fc..b0a9f8edacc 100644 --- a/samples/server/petstore/nodejs/controllers/PetService.js +++ b/samples/server/petstore/nodejs/controllers/PetService.js @@ -33,18 +33,18 @@ exports.findPetsByStatus = function(args, res, next) { **/ var examples = {}; examples['application/json'] = [ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], - "id" : 123456789, - "category" : { - "id" : 123456789, - "name" : "aeiou" - }, - "status" : "aeiou", + "photoUrls" : [ "aeiou" ], "name" : "doggie", - "photoUrls" : [ "aeiou" ] + "id" : 1, + "category" : { + "name" : "aeiou", + "id" : 7 + }, + "tags" : [ { + "name" : "aeiou", + "id" : 2 + } ], + "status" : "available" } ]; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -64,18 +64,18 @@ exports.findPetsByTags = function(args, res, next) { **/ var examples = {}; examples['application/json'] = [ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], - "id" : 123456789, - "category" : { - "id" : 123456789, - "name" : "aeiou" - }, - "status" : "aeiou", + "photoUrls" : [ "aeiou" ], "name" : "doggie", - "photoUrls" : [ "aeiou" ] + "id" : 9, + "category" : { + "name" : "aeiou", + "id" : 7 + }, + "tags" : [ { + "name" : "aeiou", + "id" : 4 + } ], + "status" : "available" } ]; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -95,18 +95,18 @@ exports.getPetById = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], - "id" : 123456789, - "category" : { - "id" : 123456789, - "name" : "aeiou" - }, - "status" : "aeiou", + "photoUrls" : [ "aeiou" ], "name" : "doggie", - "photoUrls" : [ "aeiou" ] + "id" : 4, + "category" : { + "name" : "aeiou", + "id" : 4 + }, + "tags" : [ { + "name" : "aeiou", + "id" : 4 + } ], + "status" : "available" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -152,9 +152,9 @@ exports.uploadFile = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "message" : "aeiou", - "code" : 123, - "type" : "aeiou" + "code" : 7, + "type" : "aeiou", + "message" : "aeiou" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); diff --git a/samples/server/petstore/nodejs/controllers/StoreService.js b/samples/server/petstore/nodejs/controllers/StoreService.js index 7da8e0ceb23..ec122dc6368 100644 --- a/samples/server/petstore/nodejs/controllers/StoreService.js +++ b/samples/server/petstore/nodejs/controllers/StoreService.js @@ -20,7 +20,7 @@ exports.getInventory = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "key" : 123 + "key" : 0 }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -40,12 +40,12 @@ exports.getOrderById = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "id" : 123456789, - "petId" : 123456789, - "complete" : true, - "status" : "aeiou", - "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+00:00" + "petId" : 2, + "quantity" : 9, + "id" : 5, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -65,12 +65,12 @@ exports.placeOrder = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "id" : 123456789, - "petId" : 123456789, - "complete" : true, - "status" : "aeiou", - "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+00:00" + "petId" : 5, + "quantity" : 5, + "id" : 1, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); diff --git a/samples/server/petstore/nodejs/controllers/UserService.js b/samples/server/petstore/nodejs/controllers/UserService.js index 99090323f78..762b3455f61 100644 --- a/samples/server/petstore/nodejs/controllers/UserService.js +++ b/samples/server/petstore/nodejs/controllers/UserService.js @@ -54,14 +54,14 @@ exports.getUserByName = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "id" : 123456789, - "lastName" : "aeiou", - "phone" : "aeiou", - "username" : "aeiou", - "email" : "aeiou", - "userStatus" : 123, "firstName" : "aeiou", - "password" : "aeiou" + "lastName" : "aeiou", + "password" : "aeiou", + "userStatus" : 4, + "phone" : "aeiou", + "id" : 5, + "email" : "aeiou", + "username" : "aeiou" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); From 82090c218b59cd558499a7d95a0ca03591611c27 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Mar 2017 21:48:57 +0800 Subject: [PATCH 056/132] add product hunt page --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 660bdb7d549..040dfb96713 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: +:rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: + ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: From 061f4d07d829dfaa1d0db9b6ae4780d92775db66 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Mar 2017 22:25:59 +0800 Subject: [PATCH 057/132] fix issue with pom dep in jaxrs jersey1 (#4904) --- .../JavaJaxRS/libraries/jersey1/pom.mustache | 11 +++++++++++ samples/server/petstore/jaxrs/jersey1/pom.xml | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 96e7f6a7ce1..4ac349ef1f0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -138,6 +138,16 @@ ${jersey-version} test + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + org.testng testng @@ -184,6 +194,7 @@ 1.5.12 9.2.9.v20150224 1.19.1 + 2.8.7 1.7.21 4.12 2.5 diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index decbbd651d8..feaca47dd95 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -138,6 +138,16 @@ ${jersey-version} test + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + org.testng testng @@ -179,9 +189,10 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 1.19.1 + 2.8.7 1.7.21 4.12 2.5 From 66a510c9d3e2e3b4f299e51e37e54087762f4774 Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Fri, 3 Mar 2017 09:57:57 -0500 Subject: [PATCH 058/132] Make the CodegenConfigurator serializable (#4890) Closes #4887 --- .../codegen/config/CodegenConfigurator.java | 19 ++++++++++--------- .../config/CodegenConfiguratorTest.java | 8 ++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java index b21e89711ff..86a7238cf04 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java @@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; +import java.io.Serializable; import java.nio.file.Paths; import java.util.HashMap; import java.util.HashSet; @@ -34,7 +35,7 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty; * It also has a convenience method for creating a ClientOptInput class which is THE object DefaultGenerator.java needs * to generate code. */ -public class CodegenConfigurator { +public class CodegenConfigurator implements Serializable { public static final Logger LOGGER = LoggerFactory.getLogger(CodegenConfigurator.class); @@ -62,7 +63,7 @@ public class CodegenConfigurator { private Map importMappings = new HashMap(); private Set languageSpecificPrimitives = new HashSet(); private Map reservedWordMappings = new HashMap(); - + private String gitUserId="GIT_USER_ID"; private String gitRepoId="GIT_REPO_ID"; private String releaseNote="Minor update"; @@ -155,7 +156,7 @@ public class CodegenConfigurator { // check to see if the folder exists if (!(f.exists() && f.isDirectory())) { - throw new IllegalArgumentException("Template directory " + templateDir + " does not exist."); + throw new IllegalArgumentException("Template directory " + templateDir + " does not exist."); } this.templateDir = f.getAbsolutePath(); @@ -266,7 +267,7 @@ public class CodegenConfigurator { this.additionalProperties = additionalProperties; return this; } - + public CodegenConfigurator addAdditionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; @@ -344,16 +345,16 @@ public class CodegenConfigurator { this.httpUserAgent= httpUserAgent; return this; } - + public Map getReservedWordsMappings() { return reservedWordMappings; } - + public CodegenConfigurator setReservedWordsMappings(Map reservedWordsMappings) { this.reservedWordMappings = reservedWordsMappings; return this; } - + public CodegenConfigurator addAdditionalReservedWordMapping(String key, String value) { this.reservedWordMappings.put(key, value); return this; @@ -367,7 +368,7 @@ public class CodegenConfigurator { this.ignoreFileOverride = ignoreFileOverride; return this; } - + public ClientOptInput toClientOptInput() { Validate.notEmpty(lang, "language must be specified"); @@ -388,7 +389,7 @@ public class CodegenConfigurator { config.importMapping().putAll(importMappings); config.languageSpecificPrimitives().addAll(languageSpecificPrimitives); config.reservedWordsMappings().putAll(reservedWordMappings); - + checkAndSetAdditionalProperty(apiPackage, CodegenConstants.API_PACKAGE); checkAndSetAdditionalProperty(modelPackage, CodegenConstants.MODEL_PACKAGE); checkAndSetAdditionalProperty(invokerPackage, CodegenConstants.INVOKER_PACKAGE); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java index edffc835de8..5f5a3e644a3 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java @@ -15,6 +15,7 @@ import mockit.Injectable; import mockit.Mocked; import mockit.StrictExpectations; import mockit.Tested; +import org.apache.commons.lang3.SerializationUtils; import org.testng.annotations.Test; import java.nio.file.Paths; @@ -299,6 +300,13 @@ public class CodegenConfiguratorTest { assertEquals(configurator.getIgnoreFileOverride(), "/path/to/override/.swagger-codegen-ignore"); } + @Test + public void testCodegenConfiguratorIsSerializable() { + final CodegenConfigurator configurator = CodegenConfigurator.fromFile("src/test/resources/sampleConfig.json"); + // Simply ensure that the object can be serialized + SerializationUtils.serialize(configurator); + } + @SuppressWarnings("unused") private ClientOptInput setupAndRunGenericTest(CodegenConfigurator configurator) { From 165076a4273c30520a44b571085279eefde39a03 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Sun, 5 Mar 2017 17:30:17 +0100 Subject: [PATCH 059/132] add jackson dependencies to pom #4924 --- .../JavaJaxRS/cxf/server/pom.mustache | 13 +++++++++++ samples/server/petstore/jaxrs-cxf/pom.xml | 23 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 386f337867a..6aca3eab56d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -160,6 +160,18 @@ ${cxf-version} compile + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + compile + {{#generateSpringApplication}} @@ -233,6 +245,7 @@ 1.3.3.RELEASE {{/generateSpringBootApplication}} 3.1.8 + 2.4.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index cdf3a68ed8f..3b4ff93c27e 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -112,6 +112,13 @@ ${junit-version} test + + + javax.validation + validation-api + ${beanvalidation-version} + provided + org.apache.cxf @@ -151,6 +158,18 @@ ${cxf-version} compile + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + compile + @@ -165,13 +184,15 @@ 1.7 ${java.version} ${java.version} - 1.5.10 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 1.1.7 2.5 + 1.1.0.Final 3.1.8 + 2.4.5 UTF-8 From a91cbbe38793d5fdcde94c0bd67d2dc6660413dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 5 Mar 2017 17:33:57 +0100 Subject: [PATCH 060/132] Update samples after 2.2.2 (#4901) * Update petstore samples for Groovy. * Update samples for JaxRS. * Update samples for cpprest. * Update samples for dart. * Update samples for flash. * Update samples for go. * Update samples for html2. * Update samples for lumen. * Update samples for nancxfx. * Update samples for objc. * Update samples for sinatra. * Update samples for tizen. * Update samples for java-inflector. --- .../client/petstore/cpprest/api/PetApi.cpp | 2 +- samples/client/petstore/cpprest/api/PetApi.h | 4 +-- .../client/petstore/cpprest/api/StoreApi.h | 4 +-- .../petstore/cpprest/model/Category.cpp | 2 +- .../client/petstore/cpprest/model/Order.cpp | 4 +-- samples/client/petstore/cpprest/model/Pet.cpp | 2 +- samples/client/petstore/cpprest/model/Tag.cpp | 2 +- .../client/petstore/cpprest/model/User.cpp | 2 +- .../client/petstore/dart/swagger/README.md | 4 +-- .../petstore/dart/swagger/docs/PetApi.md | 2 +- .../petstore/dart/swagger/docs/StoreApi.md | 2 +- .../petstore/dart/swagger/docs/UserApi.md | 2 +- .../petstore/flash/.swagger-codegen-ignore | 23 ++++++++++++++++ .../flash/src/io/swagger/client/api/PetApi.as | 2 +- samples/client/petstore/flash/git_push.sh | 4 +-- .../main/groovy/io/swagger/api/PetApi.groovy | 4 +-- .../groovy/io/swagger/api/StoreApi.groovy | 1 + .../main/groovy/io/swagger/model/Order.groovy | 2 +- .../main/groovy/io/swagger/model/Pet.groovy | 2 +- .../client/petstore/objc/core-data/README.md | 17 ++++++------ .../objc/core-data/SwaggerClient.podspec | 2 +- .../core-data/SwaggerClient/Api/SWGPetApi.h | 17 +++--------- .../core-data/SwaggerClient/Api/SWGPetApi.m | 4 +-- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 13 +--------- .../core-data/SwaggerClient/Api/SWGUserApi.h | 13 +--------- .../SwaggerClient/Core/SWGApiClient.h | 13 +--------- .../SwaggerClient/Core/SWGConfiguration.h | 13 +--------- .../Core/SWGDefaultConfiguration.h | 19 +++----------- .../Core/SWGDefaultConfiguration.m | 14 +++++----- .../petstore/tizen/.swagger-codegen-ignore | 23 ++++++++++++++++ .../petstore/tizen/client/SamiApiResponse.h | 2 +- .../petstore/tizen/client/SamiCategory.h | 2 +- .../client/petstore/tizen/client/SamiOrder.h | 2 +- .../client/petstore/tizen/client/SamiPet.h | 2 +- .../client/petstore/tizen/client/SamiPetApi.h | 6 ++--- .../petstore/tizen/client/SamiStoreApi.h | 4 +-- .../client/petstore/tizen/client/SamiTag.h | 2 +- .../client/petstore/tizen/client/SamiUser.h | 2 +- .../petstore/tizen/client/SamiUserApi.h | 2 +- samples/html2/index.html | 10 +++---- .../petstore/go-api-server/go/README.md | 2 +- .../src/main/swagger/swagger.yaml | 16 ++++++------ .../petstore/jaxrs-cxf-cdi/swagger.json | 14 +++++----- .../server/petstore/jaxrs-spec/swagger.json | 26 +++++++++---------- .../lib/app/Http/Controllers/FakeApi.php | 16 ++++++------ .../lib/app/Http/Controllers/StoreApi.php | 11 +++----- .../petstore/lumen/lib/app/Http/routes.php | 4 +-- .../server/petstore/nancyfx/IO.Swagger.sln | 10 +++---- .../nancyfx/src/IO.Swagger/IO.Swagger.csproj | 2 +- samples/server/petstore/sinatra/swagger.yaml | 15 +++++------ 50 files changed, 172 insertions(+), 196 deletions(-) create mode 100644 samples/client/petstore/flash/.swagger-codegen-ignore create mode 100644 samples/client/petstore/tizen/.swagger-codegen-ignore diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index c423c43e173..aa9aab9d89c 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -438,7 +438,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector { - queryParams[U("tags")] = ApiClient::parameterToArrayString<>(tags); + queryParams[U("tags")] = ApiClient::parameterToArrayString(tags); } std::shared_ptr httpBody; diff --git a/samples/client/petstore/cpprest/api/PetApi.h b/samples/client/petstore/cpprest/api/PetApi.h index 0a783c66a29..d60c3c80fca 100644 --- a/samples/client/petstore/cpprest/api/PetApi.h +++ b/samples/client/petstore/cpprest/api/PetApi.h @@ -22,10 +22,10 @@ #include "ApiClient.h" -#include "Pet.h" -#include #include "ApiResponse.h" #include "HttpContent.h" +#include "Pet.h" +#include namespace io { namespace swagger { diff --git a/samples/client/petstore/cpprest/api/StoreApi.h b/samples/client/petstore/cpprest/api/StoreApi.h index 99cbedea460..60ec088b326 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.h +++ b/samples/client/petstore/cpprest/api/StoreApi.h @@ -22,9 +22,9 @@ #include "ApiClient.h" -#include -#include #include "Order.h" +#include +#include namespace io { namespace swagger { diff --git a/samples/client/petstore/cpprest/model/Category.cpp b/samples/client/petstore/cpprest/model/Category.cpp index 9c0f21b3b22..bdb6d8e894a 100644 --- a/samples/client/petstore/cpprest/model/Category.cpp +++ b/samples/client/petstore/cpprest/model/Category.cpp @@ -21,7 +21,7 @@ namespace model { Category::Category() { - m_Id = 0L; + m_Id = 0; m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Order.cpp b/samples/client/petstore/cpprest/model/Order.cpp index 07e815fa90c..e21d867cd7e 100644 --- a/samples/client/petstore/cpprest/model/Order.cpp +++ b/samples/client/petstore/cpprest/model/Order.cpp @@ -21,9 +21,9 @@ namespace model { Order::Order() { - m_Id = 0L; + m_Id = 0; m_IdIsSet = false; - m_PetId = 0L; + m_PetId = 0; m_PetIdIsSet = false; m_Quantity = 0; m_QuantityIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Pet.cpp b/samples/client/petstore/cpprest/model/Pet.cpp index 74b707a4c26..51dd6d883e9 100644 --- a/samples/client/petstore/cpprest/model/Pet.cpp +++ b/samples/client/petstore/cpprest/model/Pet.cpp @@ -21,7 +21,7 @@ namespace model { Pet::Pet() { - m_Id = 0L; + m_Id = 0; m_IdIsSet = false; m_CategoryIsSet = false; m_Name = U(""); diff --git a/samples/client/petstore/cpprest/model/Tag.cpp b/samples/client/petstore/cpprest/model/Tag.cpp index 466ca0d29da..3cb0798c99e 100644 --- a/samples/client/petstore/cpprest/model/Tag.cpp +++ b/samples/client/petstore/cpprest/model/Tag.cpp @@ -21,7 +21,7 @@ namespace model { Tag::Tag() { - m_Id = 0L; + m_Id = 0; m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/User.cpp b/samples/client/petstore/cpprest/model/User.cpp index e9c5e969673..1ea09f35b50 100644 --- a/samples/client/petstore/cpprest/model/User.cpp +++ b/samples/client/petstore/cpprest/model/User.cpp @@ -21,7 +21,7 @@ namespace model { User::User() { - m_Id = 0L; + m_Id = 0; m_IdIsSet = false; m_Username = U(""); m_UsernameIsSet = false; diff --git a/samples/client/petstore/dart/swagger/README.md b/samples/client/petstore/dart/swagger/README.md index 92fa3e33024..6998182066d 100644 --- a/samples/client/petstore/dart/swagger/README.md +++ b/samples/client/petstore/dart/swagger/README.md @@ -4,8 +4,8 @@ This is a sample server Petstore server. You can find out more about Swagger at This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Build date: 2016-11-30T18:12:21.701+08:00 -- Build package: class io.swagger.codegen.languages.DartClientCodegen +- Build date: 2017-03-02T21:05:05.222+01:00 +- Build package: io.swagger.codegen.languages.DartClientCodegen ## Requirements diff --git a/samples/client/petstore/dart/swagger/docs/PetApi.md b/samples/client/petstore/dart/swagger/docs/PetApi.md index 04b6695dbd6..8832e57f4ab 100644 --- a/samples/client/petstore/dart/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/swagger/docs/PetApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to ** +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger/docs/StoreApi.md b/samples/client/petstore/dart/swagger/docs/StoreApi.md index 112ffe75efb..c2e5dcdfde1 100644 --- a/samples/client/petstore/dart/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/swagger/docs/StoreApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to ** +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger/docs/UserApi.md b/samples/client/petstore/dart/swagger/docs/UserApi.md index 8457602024a..2c14f3508d4 100644 --- a/samples/client/petstore/dart/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/swagger/docs/UserApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to ** +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/flash/.swagger-codegen-ignore b/samples/client/petstore/flash/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/flash/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as index 6d44370b732..34b1b7a395d 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as @@ -6,9 +6,9 @@ import io.swagger.exception.ApiError; import io.swagger.common.ApiUserCredentials; import io.swagger.event.Response; import io.swagger.common.SwaggerApi; -import io.swagger.client.model.Pet; import io.swagger.client.model.ApiResponse; import flash.filesystem.File; +import io.swagger.client.model.Pet; import mx.rpc.AsyncToken; import mx.utils.UIDUtil; diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy index d0779e65c25..b1b43f81559 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy @@ -5,9 +5,9 @@ import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* import io.swagger.api.ApiUtils -import io.swagger.model.Pet +import io.swagger.model.File import io.swagger.model.ModelApiResponse -import java.io.File +import io.swagger.model.Pet import java.util.*; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy index 0cf30090200..51047b4834b 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy @@ -5,6 +5,7 @@ import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* import io.swagger.api.ApiUtils +import io.swagger.model.Map import io.swagger.model.Order import java.util.*; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy index afc35651173..ca30463cfb4 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy @@ -3,7 +3,7 @@ package io.swagger.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import io.swagger.model.Date; @Canonical class Order { diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy index 53f113424cd..4e2bb9db157 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy @@ -3,9 +3,9 @@ package io.swagger.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.ArrayList; import io.swagger.model.Category; import io.swagger.model.Tag; -import java.util.ArrayList; import java.util.List; @Canonical class Pet { diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index eb7dc0b57a8..aca3b5b6e33 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -6,8 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-08-23T10:56:27.632+02:00 -- Build package: class io.swagger.codegen.languages.ObjcClientCodegen +- Build package: io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -56,7 +55,7 @@ Import the following: ## Recommendation -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue. +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. ## Getting Started @@ -124,6 +123,12 @@ Class | Method | HTTP request | Description ## Documentation For Authorization +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## petstore_auth - **Type**: OAuth @@ -133,12 +138,6 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## Author diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec index fd785a6255c..d00714358b1 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.frameworks = 'SystemConfiguration', 'CoreData' s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.license = "Apache License, Version 2.0" + s.license = "Proprietary" s.source = { :git => "https://github.com/swagger-api/swagger-codegen.git", :tag => "#{s.version}" } s.author = { "Swagger" => "apiteam@swagger.io" } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index ade955b27f8..74ba6e6b482 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGPetApi: NSObject extern NSString* kSWGPetApiErrorDomain; @@ -61,7 +50,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by status -/// Multiple status values can be provided with comma seperated strings +/// Multiple status values can be provided with comma separated strings /// /// @param status Status values that need to be considered for filter (optional) (default to available) /// @@ -74,7 +63,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by tags -/// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// @param tags Tags to filter by (optional) /// diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index 0034dd69fc5..c0ca97c3480 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -186,7 +186,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status -/// Multiple status values can be provided with comma seperated strings +/// Multiple status values can be provided with comma separated strings /// @param status Status values that need to be considered for filter (optional, default to available) /// /// @returns NSArray* @@ -247,7 +247,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags -/// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// @param tags Tags to filter by (optional) /// /// @returns NSArray* diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index 92aeefb176e..6cfc765cd0b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGStoreApi: NSObject extern NSString* kSWGStoreApiErrorDomain; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 2c35bdcb7b0..9695c16918b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -12,21 +12,10 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGUserApi: NSObject extern NSString* kSWGUserApiErrorDomain; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index cec2428f4b9..4edede07524 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -13,20 +13,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + /** * A key for `NSError` user info dictionaries. * diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index 864d87d2535..c5b0d2dbbe4 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -12,20 +12,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + static NSString * const kSWGAPIVersion = @"1.0.0"; @protocol SWGConfiguration diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index 48cedd5d558..d3e02965656 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -11,20 +11,9 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @class SWGApiClient; @interface SWGDefaultConfiguration : NSObject @@ -117,7 +106,7 @@ /** * Sets the prefix for API key * - * @param apiKeyPrefix API key prefix. + * @param prefix API key prefix. * @param identifier API key identifier. */ - (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; @@ -157,7 +146,7 @@ /** * Removes header from defaultHeaders * -* @param Header name. +* @param key Header name. */ -(void) removeDefaultHeaderForKey:(NSString*)key; @@ -170,7 +159,7 @@ -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; /** -* @param Header key name. +* @param key Header key name. */ -(NSString*) defaultHeaderForKey:(NSString*)key; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m index 705580e9a54..4afe43359aa 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -104,13 +104,6 @@ - (NSDictionary *) authSettings { return @{ - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, @"api_key": @{ @"type": @"api_key", @@ -118,6 +111,13 @@ @"key": @"api_key", @"value": [self getApiKeyWithPrefix:@"api_key"] }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, }; } diff --git a/samples/client/petstore/tizen/.swagger-codegen-ignore b/samples/client/petstore/tizen/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/tizen/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/tizen/client/SamiApiResponse.h b/samples/client/petstore/tizen/client/SamiApiResponse.h index 96964cc59bb..19570f9c1f8 100644 --- a/samples/client/petstore/tizen/client/SamiApiResponse.h +++ b/samples/client/petstore/tizen/client/SamiApiResponse.h @@ -1,7 +1,7 @@ /* * SamiApiResponse.h * - * + * Describes the result of uploading an image resource */ #ifndef SamiApiResponse_H_ diff --git a/samples/client/petstore/tizen/client/SamiCategory.h b/samples/client/petstore/tizen/client/SamiCategory.h index d647616809d..b29d92e967f 100644 --- a/samples/client/petstore/tizen/client/SamiCategory.h +++ b/samples/client/petstore/tizen/client/SamiCategory.h @@ -1,7 +1,7 @@ /* * SamiCategory.h * - * + * A category for a pet */ #ifndef SamiCategory_H_ diff --git a/samples/client/petstore/tizen/client/SamiOrder.h b/samples/client/petstore/tizen/client/SamiOrder.h index c8719ce14ee..5290bd6ef41 100644 --- a/samples/client/petstore/tizen/client/SamiOrder.h +++ b/samples/client/petstore/tizen/client/SamiOrder.h @@ -1,7 +1,7 @@ /* * SamiOrder.h * - * + * An order for a pets from the pet store */ #ifndef SamiOrder_H_ diff --git a/samples/client/petstore/tizen/client/SamiPet.h b/samples/client/petstore/tizen/client/SamiPet.h index 3a22ea3a58d..5c1dddece78 100644 --- a/samples/client/petstore/tizen/client/SamiPet.h +++ b/samples/client/petstore/tizen/client/SamiPet.h @@ -1,7 +1,7 @@ /* * SamiPet.h * - * + * A pet for sale in the pet store */ #ifndef SamiPet_H_ diff --git a/samples/client/petstore/tizen/client/SamiPetApi.h b/samples/client/petstore/tizen/client/SamiPetApi.h index 0b5fae406a7..89bf5c6da65 100644 --- a/samples/client/petstore/tizen/client/SamiPetApi.h +++ b/samples/client/petstore/tizen/client/SamiPetApi.h @@ -5,11 +5,11 @@ #include "SamiApiClient.h" #include "SamiError.h" -#include "SamiPet.h" using Tizen::Base::Long; -using Tizen::Base::String; -#include "SamiFile.h" #include "SamiApiResponse.h" +#include "SamiFile.h" +#include "SamiPet.h" +using Tizen::Base::String; using namespace Tizen::Net::Http; diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.h b/samples/client/petstore/tizen/client/SamiStoreApi.h index 574207a0b88..4c419bf7a87 100644 --- a/samples/client/petstore/tizen/client/SamiStoreApi.h +++ b/samples/client/petstore/tizen/client/SamiStoreApi.h @@ -5,10 +5,10 @@ #include "SamiApiClient.h" #include "SamiError.h" -using Tizen::Base::String; using Tizen::Base::Integer; -#include "SamiOrder.h" using Tizen::Base::Long; +#include "SamiOrder.h" +using Tizen::Base::String; using namespace Tizen::Net::Http; diff --git a/samples/client/petstore/tizen/client/SamiTag.h b/samples/client/petstore/tizen/client/SamiTag.h index d248df55cba..589a23a84c3 100644 --- a/samples/client/petstore/tizen/client/SamiTag.h +++ b/samples/client/petstore/tizen/client/SamiTag.h @@ -1,7 +1,7 @@ /* * SamiTag.h * - * + * A tag for a pet */ #ifndef SamiTag_H_ diff --git a/samples/client/petstore/tizen/client/SamiUser.h b/samples/client/petstore/tizen/client/SamiUser.h index 6c456ae1fa1..6e575eb7bb9 100644 --- a/samples/client/petstore/tizen/client/SamiUser.h +++ b/samples/client/petstore/tizen/client/SamiUser.h @@ -1,7 +1,7 @@ /* * SamiUser.h * - * + * A User who is purchasing from the pet store */ #ifndef SamiUser_H_ diff --git a/samples/client/petstore/tizen/client/SamiUserApi.h b/samples/client/petstore/tizen/client/SamiUserApi.h index 2851cb91419..f6ae0231e95 100644 --- a/samples/client/petstore/tizen/client/SamiUserApi.h +++ b/samples/client/petstore/tizen/client/SamiUserApi.h @@ -5,8 +5,8 @@ #include "SamiApiClient.h" #include "SamiError.h" -#include "SamiUser.h" using Tizen::Base::Collection::IList; +#include "SamiUser.h" using Tizen::Base::String; using namespace Tizen::Net::Http; diff --git a/samples/html2/index.html b/samples/html2/index.html index 92fccb3f651..9d0ad3a20f4 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -1870,8 +1870,8 @@ except ApiException as e: "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" }; @@ -4554,8 +4554,8 @@ except ApiException as e: "description" : "ID of pet that needs to be fetched", "required" : true, "type" : "integer", - "maximum" : 5.0, - "minimum" : 1.0, + "maximum" : 5, + "minimum" : 1, "format" : "int64" }; var schema = schemaWrapper; @@ -7293,7 +7293,7 @@ except ApiException as e:
- Generated 2017-02-18T23:37:57.057+01:00 + Generated 2017-03-02T21:09:32.930+01:00
diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md index 63bee39fdf0..7eef3876600 100644 --- a/samples/server/petstore/go-api-server/go/README.md +++ b/samples/server/petstore/go-api-server/go/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 -- Build date: 2016-07-20T10:23:02.662-07:00 +- Build date: 2017-03-02T21:08:51.368+01:00 ### Running the server diff --git a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml index 35f5130d3fd..3e9dc434b67 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -109,11 +109,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: @@ -623,10 +623,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_form_string" in: "formData" description: "Form parameter enum test (string)" @@ -644,10 +644,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_header_string" in: "header" description: "Header parameter enum test (string)" @@ -665,10 +665,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_query_string" in: "query" description: "Query parameter enum test (string)" @@ -839,10 +839,6 @@ paths: x-contentType: "application/json" x-accepts: "application/json" securityDefinitions: - api_key: - type: "apiKey" - name: "api_key" - in: "header" petstore_auth: type: "oauth2" authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" @@ -852,6 +848,10 @@ securityDefinitions: read:pets: "read your pets" http_basic_test: type: "basic" + api_key: + type: "apiKey" + name: "api_key" + in: "header" definitions: Order: type: "object" diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index 90ab55a1618..df8ae51dbf4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -636,11 +636,6 @@ } }, "securityDefinitions" : { - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - }, "petstore_auth" : { "type" : "oauth2", "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -649,6 +644,11 @@ "write:pets" : "modify pets in your account", "read:pets" : "read your pets" } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" } }, "definitions" : { diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 69d2c820988..410db7bf5d7 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -650,8 +650,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -669,8 +669,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -688,8 +688,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", @@ -877,11 +877,6 @@ } }, "securityDefinitions" : { - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - }, "petstore_auth" : { "type" : "oauth2", "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -893,6 +888,11 @@ }, "http_basic_test" : { "type" : "basic" + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" } }, "definitions" : { diff --git a/samples/server/petstore/lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/lumen/lib/app/Http/Controllers/FakeApi.php index 4dbbb8e28f8..5015f10d5b6 100644 --- a/samples/server/petstore/lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/lumen/lib/app/Http/Controllers/FakeApi.php @@ -101,19 +101,19 @@ class FakeApi extends Controller } $byte = $input['byte']; - if ($input['integer'] > 100.0) { - throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.'); + if ($input['integer'] > 100) { + throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); } - if ($input['integer'] < 10.0) { - throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.'); + if ($input['integer'] < 10) { + throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } $integer = $input['integer']; - if ($input['int32'] > 200.0) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.'); + if ($input['int32'] > 200) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); } - if ($input['int32'] < 20.0) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.'); + if ($input['int32'] < 20) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); } $int32 = $input['int32']; diff --git a/samples/server/petstore/lumen/lib/app/Http/Controllers/StoreApi.php b/samples/server/petstore/lumen/lib/app/Http/Controllers/StoreApi.php index 4221a0918a7..728c0f7e9c3 100644 --- a/samples/server/petstore/lumen/lib/app/Http/Controllers/StoreApi.php +++ b/samples/server/petstore/lumen/lib/app/Http/Controllers/StoreApi.php @@ -83,9 +83,6 @@ class StoreApi extends Controller $input = Request::all(); //path params validation - if ($order_id] < 1.0) { - throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.'); - } //not path params validation @@ -106,11 +103,11 @@ class StoreApi extends Controller $input = Request::all(); //path params validation - if ($order_id] > 5.0) { - throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.'); + if ($order_id] > 5) { + throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); } - if ($order_id] < 1.0) { - throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.'); + if ($order_id] < 1) { + throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); } diff --git a/samples/server/petstore/lumen/lib/app/Http/routes.php b/samples/server/petstore/lumen/lib/app/Http/routes.php index f358d7e2c8c..35a8f3fe8cf 100644 --- a/samples/server/petstore/lumen/lib/app/Http/routes.php +++ b/samples/server/petstore/lumen/lib/app/Http/routes.php @@ -24,7 +24,7 @@ $app->get('/', function () use ($app) { /** * PATCH testClientModel * Summary: To test \"client\" model - * Notes: + * Notes: To test \"client\" model * Output-Formats: [application/json] */ $app->PATCH('/v2/fake', 'FakeApi@testClientModel'); @@ -38,7 +38,7 @@ $app->POST('/v2/fake', 'FakeApi@testEndpointParameters'); /** * GET testEnumParameters * Summary: To test enum parameters - * Notes: + * Notes: To test enum parameters * Output-Formats: [*/*] */ $app->GET('/v2/fake', 'FakeApi@testEnumParameters'); diff --git a/samples/server/petstore/nancyfx/IO.Swagger.sln b/samples/server/petstore/nancyfx/IO.Swagger.sln index 38fb0ef476a..1e40deb1a14 100644 --- a/samples/server/petstore/nancyfx/IO.Swagger.sln +++ b/samples/server/petstore/nancyfx/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{9A5C2190-C960-4808-93CB-8721C1022F9B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{9A5C2190-C960-4808-93CB-8721C1022F9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{9A5C2190-C960-4808-93CB-8721C1022F9B}.Debug|Any CPU.Build.0 = Debug|Any CPU -{9A5C2190-C960-4808-93CB-8721C1022F9B}.Release|Any CPU.ActiveCfg = Release|Any CPU -{9A5C2190-C960-4808-93CB-8721C1022F9B}.Release|Any CPU.Build.0 = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj index 8bccfa94485..e1577197b6f 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - {9A5C2190-C960-4808-93CB-8721C1022F9B} + {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties IO.Swagger.v2 diff --git a/samples/server/petstore/sinatra/swagger.yaml b/samples/server/petstore/sinatra/swagger.yaml index 53ce6c55e97..60c76985c52 100644 --- a/samples/server/petstore/sinatra/swagger.yaml +++ b/samples/server/petstore/sinatra/swagger.yaml @@ -106,11 +106,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: @@ -346,8 +346,8 @@ paths: description: "ID of pet that needs to be fetched" required: true type: "integer" - maximum: 5.0 - minimum: 1.0 + maximum: 5 + minimum: 1 format: "int64" responses: 200: @@ -374,7 +374,6 @@ paths: description: "ID of the order that needs to be deleted" required: true type: "string" - minimum: 1.0 responses: 400: description: "Invalid ID supplied" @@ -567,10 +566,6 @@ paths: 404: description: "User not found" securityDefinitions: - api_key: - type: "apiKey" - name: "api_key" - in: "header" petstore_auth: type: "oauth2" authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" @@ -578,6 +573,10 @@ securityDefinitions: scopes: write:pets: "modify pets in your account" read:pets: "read your pets" + api_key: + type: "apiKey" + name: "api_key" + in: "header" definitions: Order: type: "object" From 35d3fb82ce82e86370ca24c21b0c066e8aea2f90 Mon Sep 17 00:00:00 2001 From: Viktor Chukhantsev Date: Sun, 5 Mar 2017 23:44:15 +0700 Subject: [PATCH 061/132] [Ruby] Can only use content-type application/json with ruby-client #4867 (#4893) * Fix ruby-client work with modern content types, like application/api.vnd+json * Add specs. * Fix regexp. * Regenerate petstore client. --- .../src/main/resources/ruby/api_client.mustache | 2 +- .../ruby/spec/api_client_spec.rb | 1 + .../petstore/ruby/lib/petstore/api/fake_api.rb | 16 ++++++++-------- .../petstore/ruby/lib/petstore/api/store_api.rb | 8 ++++---- .../petstore/ruby/lib/petstore/api_client.rb | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache index 7fa611e3744..cf03f368075 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache @@ -129,7 +129,7 @@ module {{moduleName}} # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. diff --git a/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb b/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb index a871ed7979e..af7258be6ed 100644 --- a/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb @@ -179,6 +179,7 @@ describe Petstore::ApiClient do expect(api_client.json_mime?('')).to eq false expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/api.vnd+json')).to eq true expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true expect(api_client.json_mime?('APPLICATION/JSON')).to eq true diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 481004db585..403705d2746 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -145,20 +145,20 @@ module Petstore # verify the required parameter 'byte' is set fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" if byte.nil? - if !opts[:'integer'].nil? && opts[:'integer'] > 100.0 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.0.' + if !opts[:'integer'].nil? && opts[:'integer'] > 100 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.' end - if !opts[:'integer'].nil? && opts[:'integer'] < 10.0 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.0.' + if !opts[:'integer'].nil? && opts[:'integer'] < 10 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.' end - if !opts[:'int32'].nil? && opts[:'int32'] > 200.0 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.0.' + if !opts[:'int32'].nil? && opts[:'int32'] > 200 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.' end - if !opts[:'int32'].nil? && opts[:'int32'] < 20.0 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.0.' + if !opts[:'int32'].nil? && opts[:'int32'] < 20 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.' end if !opts[:'float'].nil? && opts[:'float'] > 987.6 diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 39d5490b787..30e2a46dfac 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -137,12 +137,12 @@ module Petstore end # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id" if order_id.nil? - if order_id > 5.0 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.0.' + if order_id > 5 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.' end - if order_id < 1.0 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.0.' + if order_id < 1 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.' end # resource path diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index df2f05d0b64..99b2f1556f4 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -134,7 +134,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. From 7b559b44221a8b84e4ab03710badababb36ba261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 5 Mar 2017 18:12:29 +0100 Subject: [PATCH 062/132] Update samples for MSF4J after 2.2.2. (#4915) --- samples/server/petstore/java-msf4j/pom.xml | 2 +- .../src/gen/java/io/swagger/api/FakeApi.java | 12 +- .../java/io/swagger/api/FakeApiService.java | 4 +- .../src/gen/java/io/swagger/api/PetApi.java | 2 +- .../java/io/swagger/api/PetApiService.java | 2 +- .../src/gen/java/io/swagger/api/UserApi.java | 2 +- .../java/io/swagger/api/UserApiService.java | 2 +- .../src/gen/java/io/swagger/model/Animal.java | 2 + .../java/io/swagger/model/Capitalization.java | 189 ++++++++++++++++++ .../gen/java/io/swagger/model/ClassModel.java | 75 +++++++ .../gen/java/io/swagger/model/EnumTest.java | 28 ++- .../gen/java/io/swagger/model/FormatTest.java | 17 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../gen/java/io/swagger/model/OuterEnum.java | 41 ++++ .../swagger/api/impl/FakeApiServiceImpl.java | 4 +- .../swagger/api/impl/PetApiServiceImpl.java | 2 +- .../swagger/api/impl/UserApiServiceImpl.java | 2 +- 17 files changed, 364 insertions(+), 31 deletions(-) create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Capitalization.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ClassModel.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/OuterEnum.java diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index b7c61004bac..84aac08e9d3 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -81,7 +81,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java index 1ff18daec25..8d7e3c477d9 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java @@ -7,9 +7,9 @@ import io.swagger.api.factories.FakeApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -import java.math.BigDecimal; import java.util.List; import io.swagger.api.NotFoundException; @@ -36,7 +36,7 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "", response = Client.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client body @@ -75,9 +75,9 @@ public class FakeApi { } @GET - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "", response = void.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), @@ -88,7 +88,7 @@ public class FakeApi { ,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString ,@ApiParam(value = "Query parameter enum test (string array)", allowableValues=">, $") @QueryParam("enum_query_string_array") List enumQueryStringArray ,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString -,@ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") BigDecimal enumQueryInteger +,@ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") Integer enumQueryInteger ,@ApiParam(value = "Query parameter enum test (double)") @FormParam("enum_query_double") Double enumQueryDouble ) throws NotFoundException { diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java index 33a0ff02d3c..1b1e4b8603a 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java @@ -6,9 +6,9 @@ import io.swagger.model.*; import org.wso2.msf4j.formparam.FormDataParam; import org.wso2.msf4j.formparam.FileInfo; +import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -import java.math.BigDecimal; import java.util.List; import io.swagger.api.NotFoundException; @@ -43,7 +43,7 @@ public abstract class FakeApiService { ,String enumHeaderString ,List enumQueryStringArray ,String enumQueryString - ,BigDecimal enumQueryInteger + ,Integer enumQueryInteger ,Double enumQueryDouble ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java index a6b77ddc778..09c5be96450 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java @@ -7,9 +7,9 @@ import io.swagger.api.factories.PetApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import io.swagger.model.Pet; import java.io.File; import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java index f96a1305859..1aab66fe31b 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java @@ -6,9 +6,9 @@ import io.swagger.model.*; import org.wso2.msf4j.formparam.FormDataParam; import org.wso2.msf4j.formparam.FileInfo; -import io.swagger.model.Pet; import java.io.File; import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java index fe7159324b9..b09b2a52187 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java @@ -7,8 +7,8 @@ import io.swagger.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java index 5042a551342..a92e18276c6 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java @@ -6,8 +6,8 @@ import io.swagger.model.*; import org.wso2.msf4j.formparam.FormDataParam; import org.wso2.msf4j.formparam.FileInfo; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Animal.java index de739ed501c..60aaf82231f 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Animal.java @@ -3,6 +3,8 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..94cb9977104 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Capitalization.java @@ -0,0 +1,189 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Capitalization + */ + +public class Capitalization { + @JsonProperty("smallCamel") + private String smallCamel = null; + + @JsonProperty("CapitalCamel") + private String capitalCamel = null; + + @JsonProperty("small_Snake") + private String smallSnake = null; + + @JsonProperty("Capital_Snake") + private String capitalSnake = null; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints = null; + + @JsonProperty("ATT_NAME") + private String ATT_NAME = null; + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @ApiModelProperty(value = "") + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @ApiModelProperty(value = "") + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @ApiModelProperty(value = "") + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @ApiModelProperty(value = "") + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..16c743e4f32 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") + +public class ClassModel { + @JsonProperty("_class") + private String propertyClass = null; + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumTest.java index dc00d569c7e..d081e726855 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.OuterEnum; /** * EnumTest @@ -116,6 +117,9 @@ public class EnumTest { @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; + @JsonProperty("outerEnum") + private OuterEnum outerEnum = null; + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; @@ -170,6 +174,24 @@ public class EnumTest { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + @Override public boolean equals(java.lang.Object o) { @@ -182,12 +204,13 @@ public class EnumTest { EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber); + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); } @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber); + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } @Override @@ -198,6 +221,7 @@ public class EnumTest { sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/FormatTest.java index 7c882eb3fee..4c4968d4aee 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/FormatTest.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; +import java.util.UUID; /** * FormatTest @@ -47,7 +48,7 @@ public class FormatTest { private Date dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -59,8 +60,8 @@ public class FormatTest { /** * Get integer - * minimum: 10.0 - * maximum: 100.0 + * minimum: 10 + * maximum: 100 * @return integer **/ @ApiModelProperty(value = "") @@ -79,8 +80,8 @@ public class FormatTest { /** * Get int32 - * minimum: 20.0 - * maximum: 200.0 + * minimum: 20 + * maximum: 200 * @return int32 **/ @ApiModelProperty(value = "") @@ -260,7 +261,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -270,11 +271,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5a55ab81d68..0a1edad338e 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -17,7 +18,7 @@ import java.util.Map; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private Date dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..0abc3d063b5 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,41 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 43e07c14462..36f2787cd1f 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -3,9 +3,9 @@ package io.swagger.api.impl; import io.swagger.api.*; import io.swagger.model.*; +import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -import java.math.BigDecimal; import java.util.List; import io.swagger.api.NotFoundException; @@ -52,7 +52,7 @@ public class FakeApiServiceImpl extends FakeApiService { , String enumHeaderString , List enumQueryStringArray , String enumQueryString -, BigDecimal enumQueryInteger +, Integer enumQueryInteger , Double enumQueryDouble ) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index ea6b7553a52..d298d1e45d2 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -3,9 +3,9 @@ package io.swagger.api.impl; import io.swagger.api.*; import io.swagger.model.*; -import io.swagger.model.Pet; import java.io.File; import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index babd595dca8..044080093b8 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -3,8 +3,8 @@ package io.swagger.api.impl; import io.swagger.api.*; import io.swagger.model.*; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; import java.util.List; import io.swagger.api.NotFoundException; From 7800641db21dcb48051f0f9bb4a9cb415d01d994 Mon Sep 17 00:00:00 2001 From: jsone-studios Date: Sun, 5 Mar 2017 18:15:56 +0100 Subject: [PATCH 063/132] Fixes #4913 (#4914) --- .../languages/StaticHtml2Generator.java | 18 +- .../test/resources/2_0/responseCodeTest.yaml | 17 + samples/html2/index.html | 4200 +---------------- 3 files changed, 65 insertions(+), 4170 deletions(-) create mode 100644 modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java index 3fbfd90e5e0..dba87bf44cb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java @@ -1,15 +1,24 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.CodegenResponse; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.codegen.SupportingFile; +import io.swagger.models.Info; import io.swagger.models.Model; import io.swagger.models.Operation; import io.swagger.models.Swagger; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; -import io.swagger.models.Info; import org.apache.commons.lang3.StringUtils; + import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -113,6 +122,11 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { op.httpMethod = op.httpMethod.toLowerCase(); + for (CodegenResponse response : op.responses){ + if ("0".equals(response.code)){ + response.code = "default"; + } + } } return objs; } diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml b/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml new file mode 100644 index 00000000000..73e20403b5b --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml @@ -0,0 +1,17 @@ +swagger: '2.0' +info: + description: 'Test for response code default' + version: 1.0.0 + title: Response code test +basePath: / +paths: + /test: + get: + summary: Test + produces: + - application/json + responses: + 200: + description: successful operation + default: + description: Internal server error \ No newline at end of file diff --git a/samples/html2/index.html b/samples/html2/index.html index 9d0ad3a20f4..51bc43a4f01 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -988,227 +988,12 @@ margin-bottom: 20px;
-

-

-


/pet
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/pet"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        Pet body = ; // Pet | Pet object that needs to be added to the store
-        try {
-            apiInstance.addPet(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#addPet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Pet body = ; // Pet | Pet object that needs to be added to the store
-        try {
-            apiInstance.addPet(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#addPet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-Pet *body = ; // Pet object that needs to be added to the store
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Add a new pet to the store
-[apiInstance addPetWith:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var body = ; // {Pet} Pet object that needs to be added to the store
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.addPet(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class addPetExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var body = new Pet(); // Pet | Pet object that needs to be added to the store
-
-            try
-            {
-                // Add a new pet to the store
-                apiInstance.addPet(body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.addPet: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$body = ; // Pet | Pet object that needs to be added to the store
-
-try {
-    $api_instance->addPet($body);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$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
-
-eval { 
-    $api_instance->addPet(body => $body);
-};
-if ($@) {
-    warn "Exception when calling PetApi->addPet: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-body =  # Pet | Pet object that needs to be added to the store
-
-try: 
-    # Add a new pet to the store
-    api_instance.addPet(body)
-except ApiException as e:
-    print("Exception when calling PetApi->addPet: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -1283,236 +1068,10 @@ except ApiException as e:
-

-

-


/pet/{petId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X delete "http://petstore.swagger.io/v2/pet/{petId}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | Pet id to delete
-        String apiKey = apiKey_example; // String | 
-        try {
-            apiInstance.deletePet(petId, apiKey);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#deletePet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | Pet id to delete
-        String apiKey = apiKey_example; // String | 
-        try {
-            apiInstance.deletePet(petId, apiKey);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#deletePet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-Long *petId = 789; // Pet id to delete
-String *apiKey = apiKey_example; //  (optional)
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Deletes a pet
-[apiInstance deletePetWith:petId
-    apiKey:apiKey
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var petId = 789; // {Long} Pet id to delete
-
-var opts = { 
-  'apiKey': apiKey_example // {String} 
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.deletePet(petId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class deletePetExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var petId = 789;  // Long | Pet id to delete
-            var apiKey = apiKey_example;  // String |  (optional) 
-
-            try
-            {
-                // Deletes a pet
-                apiInstance.deletePet(petId, apiKey);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.deletePet: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$petId = 789; // Long | Pet id to delete
-$apiKey = apiKey_example; // String | 
-
-try {
-    $api_instance->deletePet($petId, $apiKey);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | Pet id to delete
-my $apiKey = apiKey_example; # String | 
-
-eval { 
-    $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
-};
-if ($@) {
-    warn "Exception when calling PetApi->deletePet: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | Pet id to delete
-apiKey = apiKey_example # String |  (optional)
-
-try: 
-    # Deletes a pet
-    api_instance.deletePet(petId, apiKey=apiKey)
-except ApiException as e:
-    print("Exception when calling PetApi->deletePet: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -1618,238 +1177,17 @@ except ApiException as e:
-

-

Multiple status values can be provided with comma separated strings

-

+

+

Multiple status values can be provided with comma separated strings

+


/pet/findByStatus
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/pet/findByStatus?status="
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        array[String] status = ; // array[String] | Status values that need to be considered for filter
-        try {
-            array[Pet] result = apiInstance.findPetsByStatus(status);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#findPetsByStatus");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        array[String] status = ; // array[String] | Status values that need to be considered for filter
-        try {
-            array[Pet] result = apiInstance.findPetsByStatus(status);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#findPetsByStatus");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-array[String] *status = ; // Status values that need to be considered for filter
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Finds Pets by status
-[apiInstance findPetsByStatusWith:status
-              completionHandler: ^(array[Pet] output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var status = ; // {array[String]} Status values that need to be considered for filter
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.findPetsByStatus(status, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class findPetsByStatusExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var status = new array[String](); // array[String] | Status values that need to be considered for filter
-
-            try
-            {
-                // Finds Pets by status
-                array[Pet] result = apiInstance.findPetsByStatus(status);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.findPetsByStatus: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$status = ; // array[String] | Status values that need to be considered for filter
-
-try {
-    $result = $api_instance->findPetsByStatus($status);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$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 filter
-
-eval { 
-    my $result = $api_instance->findPetsByStatus(status => $status);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling PetApi->findPetsByStatus: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-status =  # array[String] | Status values that need to be considered for filter
-
-try: 
-    # Finds Pets by status
-    api_response = api_instance.findPetsByStatus(status)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling PetApi->findPetsByStatus: %s\n" % e)
-
-

Parameters

-
Query parameters
@@ -1962,238 +1300,17 @@ except ApiException as e:
-

-

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

-

+

+

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

+


/pet/findByTags
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/pet/findByTags?tags="
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        array[String] tags = ; // array[String] | Tags to filter by
-        try {
-            array[Pet] result = apiInstance.findPetsByTags(tags);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#findPetsByTags");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        array[String] tags = ; // array[String] | Tags to filter by
-        try {
-            array[Pet] result = apiInstance.findPetsByTags(tags);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#findPetsByTags");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-array[String] *tags = ; // Tags to filter by
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Finds Pets by tags
-[apiInstance findPetsByTagsWith:tags
-              completionHandler: ^(array[Pet] output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var tags = ; // {array[String]} Tags to filter by
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.findPetsByTags(tags, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class findPetsByTagsExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var tags = new array[String](); // array[String] | Tags to filter by
-
-            try
-            {
-                // Finds Pets by tags
-                array[Pet] result = apiInstance.findPetsByTags(tags);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.findPetsByTags: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$tags = ; // array[String] | Tags to filter by
-
-try {
-    $result = $api_instance->findPetsByTags($tags);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $tags = []; # array[String] | Tags to filter by
-
-eval { 
-    my $result = $api_instance->findPetsByTags(tags => $tags);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling PetApi->findPetsByTags: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-tags =  # array[String] | Tags to filter by
-
-try: 
-    # Finds Pets by tags
-    api_response = api_instance.findPetsByTags(tags)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling PetApi->findPetsByTags: %s\n" % e)
-
-

Parameters

-
Query parameters
@@ -2304,248 +1421,13 @@ except ApiException as e:
-

-

Returns a single pet

-

+

+

Returns a single pet

+


/pet/{petId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure API key authorization: api_key
-        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
-        api_key.setApiKey("YOUR API KEY");
-        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-        //api_key.setApiKeyPrefix("Token");
-
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet to return
-        try {
-            Pet result = apiInstance.getPetById(petId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#getPetById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet to return
-        try {
-            Pet result = apiInstance.getPetById(petId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#getPetById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure API key authorization: (authentication scheme: api_key)
-[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
-
-Long *petId = 789; // ID of pet to return
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Find pet by ID
-[apiInstance getPetByIdWith:petId
-              completionHandler: ^(Pet output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure API key authorization: api_key
-var api_key = defaultClient.authentications['api_key'];
-api_key.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//api_key.apiKeyPrefix['api_key'] = "Token"
-
-var api = new SwaggerPetstore.PetApi()
-
-var petId = 789; // {Long} ID of pet to return
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getPetById(petId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class getPetByIdExample
-    {
-        public void main()
-        {
-            
-            // Configure API key authorization: api_key
-            Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
-            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-            // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
-
-            var apiInstance = new PetApi();
-            var petId = 789;  // Long | ID of pet to return
-
-            try
-            {
-                // Find pet by ID
-                Pet result = apiInstance.getPetById(petId);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.getPetById: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure API key authorization: api_key
-Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$petId = 789; // Long | ID of pet to return
-
-try {
-    $result = $api_instance->getPetById($petId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure API key authorization: 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";
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet to return
-
-eval { 
-    my $result = $api_instance->getPetById(petId => $petId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling PetApi->getPetById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure API key authorization: api_key
-swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet to return
-
-try: 
-    # Find pet by ID
-    api_response = api_instance.getPetById(petId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling PetApi->getPetById: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -2662,227 +1544,12 @@ except ApiException as e:
-

-

-


/pet
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X put "http://petstore.swagger.io/v2/pet"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        Pet body = ; // Pet | Pet object that needs to be added to the store
-        try {
-            apiInstance.updatePet(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#updatePet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Pet body = ; // Pet | Pet object that needs to be added to the store
-        try {
-            apiInstance.updatePet(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#updatePet");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-Pet *body = ; // Pet object that needs to be added to the store
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Update an existing pet
-[apiInstance updatePetWith:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var body = ; // {Pet} Pet object that needs to be added to the store
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.updatePet(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class updatePetExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var body = new Pet(); // Pet | Pet object that needs to be added to the store
-
-            try
-            {
-                // Update an existing pet
-                apiInstance.updatePet(body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.updatePet: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$body = ; // Pet | Pet object that needs to be added to the store
-
-try {
-    $api_instance->updatePet($body);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$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
-
-eval { 
-    $api_instance->updatePet(body => $body);
-};
-if ($@) {
-    warn "Exception when calling PetApi->updatePet: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-body =  # Pet | Pet object that needs to be added to the store
-
-try: 
-    # Update an existing pet
-    api_instance.updatePet(body)
-except ApiException as e:
-    print("Exception when calling PetApi->updatePet: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -2973,245 +1640,10 @@ except ApiException as e:
-

-

-


/pet/{petId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/pet/{petId}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet that needs to be updated
-        String name = name_example; // String | Updated name of the pet
-        String status = status_example; // String | Updated status of the pet
-        try {
-            apiInstance.updatePetWithForm(petId, name, status);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#updatePetWithForm");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet that needs to be updated
-        String name = name_example; // String | Updated name of the pet
-        String status = status_example; // String | Updated status of the pet
-        try {
-            apiInstance.updatePetWithForm(petId, name, status);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#updatePetWithForm");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-Long *petId = 789; // ID of pet that needs to be updated
-String *name = name_example; // Updated name of the pet (optional)
-String *status = status_example; // Updated status of the pet (optional)
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// Updates a pet in the store with form data
-[apiInstance updatePetWithFormWith:petId
-    name:name
-    status:status
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var petId = 789; // {Long} ID of pet that needs to be updated
-
-var opts = { 
-  'name': name_example, // {String} Updated name of the pet
-  'status': status_example // {String} Updated status of the pet
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.updatePetWithForm(petId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class updatePetWithFormExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var petId = 789;  // Long | ID of pet that needs to be updated
-            var name = name_example;  // String | Updated name of the pet (optional) 
-            var status = status_example;  // String | Updated status of the pet (optional) 
-
-            try
-            {
-                // Updates a pet in the store with form data
-                apiInstance.updatePetWithForm(petId, name, status);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.updatePetWithForm: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$petId = 789; // Long | ID of pet that needs to be updated
-$name = name_example; // String | Updated name of the pet
-$status = status_example; // String | Updated status of the pet
-
-try {
-    $api_instance->updatePetWithForm($petId, $name, $status);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet that needs to be updated
-my $name = name_example; # String | Updated name of the pet
-my $status = status_example; # String | Updated status of the pet
-
-eval { 
-    $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
-};
-if ($@) {
-    warn "Exception when calling PetApi->updatePetWithForm: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet that needs to be updated
-name = name_example # String | Updated name of the pet (optional)
-status = status_example # String | Updated status of the pet (optional)
-
-try: 
-    # Updates a pet in the store with form data
-    api_instance.updatePetWithForm(petId, name=name, status=status)
-except ApiException as e:
-    print("Exception when calling PetApi->updatePetWithForm: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -3351,254 +1783,10 @@ except ApiException as e:
-

-

-


/pet/{petId}/uploadImage
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
-
-import java.io.File;
-import java.util.*;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure OAuth2 access token for authorization: petstore_auth
-        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
-        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
-
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet to update
-        String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
-        File file = /path/to/file.txt; // File | file to upload
-        try {
-            ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#uploadFile");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.PetApi;
-
-public class PetApiExample {
-
-    public static void main(String[] args) {
-        PetApi apiInstance = new PetApi();
-        Long petId = 789; // Long | ID of pet to update
-        String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
-        File file = /path/to/file.txt; // File | file to upload
-        try {
-            ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling PetApi#uploadFile");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-Long *petId = 789; // ID of pet to update
-String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional)
-File *file = /path/to/file.txt; // file to upload (optional)
-
-PetApi *apiInstance = [[PetApi alloc] init];
-
-// uploads an image
-[apiInstance uploadFileWith:petId
-    additionalMetadata:additionalMetadata
-    file:file
-              completionHandler: ^(ApiResponse output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure OAuth2 access token for authorization: petstore_auth
-var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-
-var api = new SwaggerPetstore.PetApi()
-
-var petId = 789; // {Long} ID of pet to update
-
-var opts = { 
-  'additionalMetadata': additionalMetadata_example, // {String} Additional data to pass to server
-  'file': /path/to/file.txt // {File} file to upload
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.uploadFile(petId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class uploadFileExample
-    {
-        public void main()
-        {
-            
-            // Configure OAuth2 access token for authorization: petstore_auth
-            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
-
-            var apiInstance = new PetApi();
-            var petId = 789;  // Long | ID of pet to update
-            var additionalMetadata = additionalMetadata_example;  // String | Additional data to pass to server (optional) 
-            var file = new File(); // File | file to upload (optional) 
-
-            try
-            {
-                // uploads an image
-                ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling PetApi.uploadFile: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$petId = 789; // Long | ID of pet to update
-$additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
-$file = /path/to/file.txt; // File | file to upload
-
-try {
-    $result = $api_instance->uploadFile($petId, $additionalMetadata, $file);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet to update
-my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
-my $file = /path/to/file.txt; # File | file to upload
-
-eval { 
-    my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling PetApi->uploadFile: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet to update
-additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional)
-file = /path/to/file.txt # File | file to upload (optional)
-
-try: 
-    # uploads an image
-    api_response = api_instance.uploadFile(petId, additionalMetadata=additionalMetadata, file=file)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling PetApi->uploadFile: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -3775,198 +1963,13 @@ except ApiException as e:
-

-

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

-

+

+

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

+


/store/order/{orderId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X delete "http://petstore.swagger.io/v2/store/order/{orderId}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
-
-import java.io.File;
-import java.util.*;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        
-        StoreApi apiInstance = new StoreApi();
-        String orderId = orderId_example; // String | ID of the order that needs to be deleted
-        try {
-            apiInstance.deleteOrder(orderId);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#deleteOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.StoreApi;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        StoreApi apiInstance = new StoreApi();
-        String orderId = orderId_example; // String | ID of the order that needs to be deleted
-        try {
-            apiInstance.deleteOrder(orderId);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#deleteOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
String *orderId = orderId_example; // ID of the order that needs to be deleted
-
-StoreApi *apiInstance = [[StoreApi alloc] init];
-
-// Delete purchase order by ID
-[apiInstance deleteOrderWith:orderId
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.StoreApi()
-
-var orderId = orderId_example; // {String} ID of the order that needs to be deleted
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.deleteOrder(orderId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class deleteOrderExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new StoreApi();
-            var orderId = orderId_example;  // String | ID of the order that needs to be deleted
-
-            try
-            {
-                // Delete purchase order by ID
-                apiInstance.deleteOrder(orderId);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling StoreApi.deleteOrder: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\StoreApi();
-$orderId = orderId_example; // String | ID of the order that needs to be deleted
-
-try {
-    $api_instance->deleteOrder($orderId);
-} catch (Exception $e) {
-    echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $orderId = orderId_example; # String | ID of the order that needs to be deleted
-
-eval { 
-    $api_instance->deleteOrder(orderId => $orderId);
-};
-if ($@) {
-    warn "Exception when calling StoreApi->deleteOrder: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-orderId = orderId_example # String | ID of the order that needs to be deleted
-
-try: 
-    # Delete purchase order by ID
-    api_instance.deleteOrder(orderId)
-except ApiException as e:
-    print("Exception when calling StoreApi->deleteOrder: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -4040,235 +2043,11 @@ except ApiException as e:
-

-

Returns a map of status codes to quantities

-

+

+

Returns a map of status codes to quantities

+


/store/inventory
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
-
-import java.io.File;
-import java.util.*;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        ApiClient defaultClient = Configuration.getDefaultApiClient();
-        
-        // Configure API key authorization: api_key
-        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
-        api_key.setApiKey("YOUR API KEY");
-        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-        //api_key.setApiKeyPrefix("Token");
-
-        StoreApi apiInstance = new StoreApi();
-        try {
-            map['String', 'Integer'] result = apiInstance.getInventory();
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#getInventory");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.StoreApi;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        StoreApi apiInstance = new StoreApi();
-        try {
-            map['String', 'Integer'] result = apiInstance.getInventory();
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#getInventory");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure API key authorization: (authentication scheme: api_key)
-[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
-
-
-StoreApi *apiInstance = [[StoreApi alloc] init];
-
-// Returns pet inventories by status
-[apiInstance getInventoryWithCompletionHandler: 
-              ^(map['String', 'Integer'] output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
-
-// Configure API key authorization: api_key
-var api_key = defaultClient.authentications['api_key'];
-api_key.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//api_key.apiKeyPrefix['api_key'] = "Token"
-
-var api = new SwaggerPetstore.StoreApi()
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getInventory(callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class getInventoryExample
-    {
-        public void main()
-        {
-            
-            // Configure API key authorization: api_key
-            Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
-            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-            // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
-
-            var apiInstance = new StoreApi();
-
-            try
-            {
-                // Returns pet inventories by status
-                map['String', 'Integer'] result = apiInstance.getInventory();
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling StoreApi.getInventory: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure API key authorization: api_key
-Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
-
-$api_instance = new Swagger\Client\Api\StoreApi();
-
-try {
-    $result = $api_instance->getInventory();
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-# Configure API key authorization: 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";
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-
-eval { 
-    my $result = $api_instance->getInventory();
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling StoreApi->getInventory: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure API key authorization: api_key
-swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-
-try: 
-    # Returns pet inventories by status
-    api_response = api_instance.getInventory()
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling StoreApi->getInventory: %s\n" % e)
-
-

Parameters

@@ -4276,7 +2055,6 @@ except ApiException as e: -

Responses

Status: 200 - successful operation

@@ -4335,207 +2113,13 @@ except ApiException as e:
-

-

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

-

+

+

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

+


/store/order/{orderId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/store/order/{orderId}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
-
-import java.io.File;
-import java.util.*;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        
-        StoreApi apiInstance = new StoreApi();
-        Long orderId = 789; // Long | ID of pet that needs to be fetched
-        try {
-            Order result = apiInstance.getOrderById(orderId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#getOrderById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.StoreApi;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        StoreApi apiInstance = new StoreApi();
-        Long orderId = 789; // Long | ID of pet that needs to be fetched
-        try {
-            Order result = apiInstance.getOrderById(orderId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#getOrderById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Long *orderId = 789; // ID of pet that needs to be fetched
-
-StoreApi *apiInstance = [[StoreApi alloc] init];
-
-// Find purchase order by ID
-[apiInstance getOrderByIdWith:orderId
-              completionHandler: ^(Order output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.StoreApi()
-
-var orderId = 789; // {Long} ID of pet that needs to be fetched
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getOrderById(orderId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class getOrderByIdExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new StoreApi();
-            var orderId = 789;  // Long | ID of pet that needs to be fetched
-
-            try
-            {
-                // Find purchase order by ID
-                Order result = apiInstance.getOrderById(orderId);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling StoreApi.getOrderById: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\StoreApi();
-$orderId = 789; // Long | ID of pet that needs to be fetched
-
-try {
-    $result = $api_instance->getOrderById($orderId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $orderId = 789; # Long | ID of pet that needs to be fetched
-
-eval { 
-    my $result = $api_instance->getOrderById(orderId => $orderId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling StoreApi->getOrderById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-orderId = 789 # Long | ID of pet that needs to be fetched
-
-try: 
-    # Find purchase order by ID
-    api_response = api_instance.getOrderById(orderId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling StoreApi->getOrderById: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -4654,209 +2238,12 @@ except ApiException as e:
-

-

-


/store/order
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/store/order"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
-
-import java.io.File;
-import java.util.*;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        
-        StoreApi apiInstance = new StoreApi();
-        Order body = ; // Order | order placed for purchasing the pet
-        try {
-            Order result = apiInstance.placeOrder(body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#placeOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.StoreApi;
-
-public class StoreApiExample {
-
-    public static void main(String[] args) {
-        StoreApi apiInstance = new StoreApi();
-        Order body = ; // Order | order placed for purchasing the pet
-        try {
-            Order result = apiInstance.placeOrder(body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling StoreApi#placeOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Order *body = ; // order placed for purchasing the pet
-
-StoreApi *apiInstance = [[StoreApi alloc] init];
-
-// Place an order for a pet
-[apiInstance placeOrderWith:body
-              completionHandler: ^(Order output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.StoreApi()
-
-var body = ; // {Order} order placed for purchasing the pet
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.placeOrder(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class placeOrderExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new StoreApi();
-            var body = new Order(); // Order | order placed for purchasing the pet
-
-            try
-            {
-                // Place an order for a pet
-                Order result = apiInstance.placeOrder(body);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling StoreApi.placeOrder: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\StoreApi();
-$body = ; // Order | order placed for purchasing the pet
-
-try {
-    $result = $api_instance->placeOrder($body);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
-
-eval { 
-    my $result = $api_instance->placeOrder(body => $body);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling StoreApi->placeOrder: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-body =  # Order | order placed for purchasing the pet
-
-try: 
-    # Place an order for a pet
-    api_response = api_instance.placeOrder(body)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling StoreApi->placeOrder: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -4976,200 +2363,15 @@ except ApiException as e:
-

-

This can only be done by the logged in user.

-

+

+

This can only be done by the logged in user.

+


/user
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/user"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        User body = ; // User | Created user object
-        try {
-            apiInstance.createUser(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        User body = ; // User | Created user object
-        try {
-            apiInstance.createUser(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
User *body = ; // Created user object
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Create user
-[apiInstance createUserWith:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var body = ; // {User} Created user object
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.createUser(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class createUserExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var body = new User(); // User | Created user object
-
-            try
-            {
-                // Create user
-                apiInstance.createUser(body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.createUser: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$body = ; // User | Created user object
-
-try {
-    $api_instance->createUser($body);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = WWW::SwaggerClient::Object::User->new(); # User | Created user object
-
-eval { 
-    $api_instance->createUser(body => $body);
-};
-if ($@) {
-    warn "Exception when calling UserApi->createUser: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body =  # User | Created user object
-
-try: 
-    # Create user
-    api_instance.createUser(body)
-except ApiException as e:
-    print("Exception when calling UserApi->createUser: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -5225,7 +2427,7 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

@@ -5244,200 +2446,12 @@ except ApiException as e:
-

-

-


/user/createWithArray
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/user/createWithArray"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        array[User] body = ; // array[User] | List of user object
-        try {
-            apiInstance.createUsersWithArrayInput(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        array[User] body = ; // array[User] | List of user object
-        try {
-            apiInstance.createUsersWithArrayInput(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
array[User] *body = ; // List of user object
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Creates list of users with given input array
-[apiInstance createUsersWithArrayInputWith:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var body = ; // {array[User]} List of user object
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.createUsersWithArrayInput(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class createUsersWithArrayInputExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var body = new array[User](); // array[User] | List of user object
-
-            try
-            {
-                // Creates list of users with given input array
-                apiInstance.createUsersWithArrayInput(body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.createUsersWithArrayInput: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$body = ; // array[User] | List of user object
-
-try {
-    $api_instance->createUsersWithArrayInput($body);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
-
-eval { 
-    $api_instance->createUsersWithArrayInput(body => $body);
-};
-if ($@) {
-    warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body =  # array[User] | List of user object
-
-try: 
-    # Creates list of users with given input array
-    api_instance.createUsersWithArrayInput(body)
-except ApiException as e:
-    print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -5496,7 +2510,7 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

@@ -5515,200 +2529,12 @@ except ApiException as e:
-

-

-


/user/createWithList
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X post "http://petstore.swagger.io/v2/user/createWithList"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        array[User] body = ; // array[User] | List of user object
-        try {
-            apiInstance.createUsersWithListInput(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUsersWithListInput");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        array[User] body = ; // array[User] | List of user object
-        try {
-            apiInstance.createUsersWithListInput(body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#createUsersWithListInput");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
array[User] *body = ; // List of user object
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Creates list of users with given input array
-[apiInstance createUsersWithListInputWith:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var body = ; // {array[User]} List of user object
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.createUsersWithListInput(body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class createUsersWithListInputExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var body = new array[User](); // array[User] | List of user object
-
-            try
-            {
-                // Creates list of users with given input array
-                apiInstance.createUsersWithListInput(body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.createUsersWithListInput: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$body = ; // array[User] | List of user object
-
-try {
-    $api_instance->createUsersWithListInput($body);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
-
-eval { 
-    $api_instance->createUsersWithListInput(body => $body);
-};
-if ($@) {
-    warn "Exception when calling UserApi->createUsersWithListInput: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body =  # array[User] | List of user object
-
-try: 
-    # Creates list of users with given input array
-    api_instance.createUsersWithListInput(body)
-except ApiException as e:
-    print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
-
-

Parameters

-
Body parameters
@@ -5767,7 +2593,7 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

@@ -5786,198 +2612,13 @@ except ApiException as e:
-

-

This can only be done by the logged in user.

-

+

+

This can only be done by the logged in user.

+


/user/{username}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X delete "http://petstore.swagger.io/v2/user/{username}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The name that needs to be deleted
-        try {
-            apiInstance.deleteUser(username);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#deleteUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The name that needs to be deleted
-        try {
-            apiInstance.deleteUser(username);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#deleteUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
String *username = username_example; // The name that needs to be deleted
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Delete user
-[apiInstance deleteUserWith:username
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var username = username_example; // {String} The name that needs to be deleted
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.deleteUser(username, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class deleteUserExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var username = username_example;  // String | The name that needs to be deleted
-
-            try
-            {
-                // Delete user
-                apiInstance.deleteUser(username);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.deleteUser: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$username = username_example; // String | The name that needs to be deleted
-
-try {
-    $api_instance->deleteUser($username);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The name that needs to be deleted
-
-eval { 
-    $api_instance->deleteUser(username => $username);
-};
-if ($@) {
-    warn "Exception when calling UserApi->deleteUser: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The name that needs to be deleted
-
-try: 
-    # Delete user
-    api_instance.deleteUser(username)
-except ApiException as e:
-    print("Exception when calling UserApi->deleteUser: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -6051,207 +2692,10 @@ except ApiException as e:
-

-

-


/user/{username}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/user/{username}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
-        try {
-            User result = apiInstance.getUserByName(username);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#getUserByName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
-        try {
-            User result = apiInstance.getUserByName(username);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#getUserByName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
String *username = username_example; // The name that needs to be fetched. Use user1 for testing. 
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Get user by user name
-[apiInstance getUserByNameWith:username
-              completionHandler: ^(User output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var username = username_example; // {String} The name that needs to be fetched. Use user1 for testing. 
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getUserByName(username, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class getUserByNameExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var username = username_example;  // String | The name that needs to be fetched. Use user1 for testing. 
-
-            try
-            {
-                // Get user by user name
-                User result = apiInstance.getUserByName(username);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.getUserByName: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
-
-try {
-    $result = $api_instance->getUserByName($username);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing. 
-
-eval { 
-    my $result = $api_instance->getUserByName(username => $username);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling UserApi->getUserByName: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The name that needs to be fetched. Use user1 for testing. 
-
-try: 
-    # Get user by user name
-    api_response = api_instance.getUserByName(username)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling UserApi->getUserByName: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -6367,221 +2811,14 @@ except ApiException as e:
-

-

-


/user/login
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/user/login?username=&password="
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The user name for login
-        String password = password_example; // String | The password for login in clear text
-        try {
-            'String' result = apiInstance.loginUser(username, password);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#loginUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | The user name for login
-        String password = password_example; // String | The password for login in clear text
-        try {
-            'String' result = apiInstance.loginUser(username, password);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#loginUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
String *username = username_example; // The user name for login
-String *password = password_example; // The password for login in clear text
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Logs user into the system
-[apiInstance loginUserWith:username
-    password:password
-              completionHandler: ^('String' output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var username = username_example; // {String} The user name for login
-
-var password = password_example; // {String} The password for login in clear text
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.loginUser(username, password, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class loginUserExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var username = username_example;  // String | The user name for login
-            var password = password_example;  // String | The password for login in clear text
-
-            try
-            {
-                // Logs user into the system
-                'String' result = apiInstance.loginUser(username, password);
-                Debug.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.loginUser: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$username = username_example; // String | The user name for login
-$password = password_example; // String | The password for login in clear text
-
-try {
-    $result = $api_instance->loginUser($username, $password);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The user name for login
-my $password = password_example; # String | The password for login in clear text
-
-eval { 
-    my $result = $api_instance->loginUser(username => $username, password => $password);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling UserApi->loginUser: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The user name for login
-password = password_example # String | The password for login in clear text
-
-try: 
-    # Logs user into the system
-    api_response = api_instance.loginUser(username, password)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling UserApi->loginUser: %s\n" % e)
-
-

Parameters

-
Query parameters
@@ -6755,185 +2992,8 @@ except ApiException as e:
-

-

-


/user/logout
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X get "http://petstore.swagger.io/v2/user/logout"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        try {
-            apiInstance.logoutUser();
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#logoutUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        try {
-            apiInstance.logoutUser();
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#logoutUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Logs out current logged in user session
-[apiInstance logoutUserWithCompletionHandler: 
-              ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.logoutUser(callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class logoutUserExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-
-            try
-            {
-                // Logs out current logged in user session
-                apiInstance.logoutUser();
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.logoutUser: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-
-try {
-    $api_instance->logoutUser();
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-
-eval { 
-    $api_instance->logoutUser();
-};
-if ($@) {
-    warn "Exception when calling UserApi->logoutUser: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-
-try: 
-    # Logs out current logged in user session
-    api_instance.logoutUser()
-except ApiException as e:
-    print("Exception when calling UserApi->logoutUser: %s\n" % e)
-
-

Parameters

@@ -6941,9 +3001,8 @@ except ApiException as e: -

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

@@ -6962,208 +3021,13 @@ except ApiException as e:
-

-

This can only be done by the logged in user.

-

+

+

This can only be done by the logged in user.

+


/user/{username}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X put "http://petstore.swagger.io/v2/user/{username}"
-
-
-
import io.swagger.client.*;
-import io.swagger.client.auth.*;
-import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
-
-import java.io.File;
-import java.util.*;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | name that need to be deleted
-        User body = ; // User | Updated user object
-        try {
-            apiInstance.updateUser(username, body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#updateUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import io.swagger.client.api.UserApi;
-
-public class UserApiExample {
-
-    public static void main(String[] args) {
-        UserApi apiInstance = new UserApi();
-        String username = username_example; // String | name that need to be deleted
-        User body = ; // User | Updated user object
-        try {
-            apiInstance.updateUser(username, body);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling UserApi#updateUser");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
String *username = username_example; // name that need to be deleted
-User *body = ; // Updated user object
-
-UserApi *apiInstance = [[UserApi alloc] init];
-
-// Updated user
-[apiInstance updateUserWith:username
-    body:body
-              completionHandler: ^(NSError* error) {
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
var SwaggerPetstore = require('swagger_petstore');
-
-var api = new SwaggerPetstore.UserApi()
-
-var username = username_example; // {String} name that need to be deleted
-
-var body = ; // {User} Updated user object
-
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully.');
-  }
-};
-api.updateUser(username, body, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
-
-namespace Example
-{
-    public class updateUserExample
-    {
-        public void main()
-        {
-            
-            var apiInstance = new UserApi();
-            var username = username_example;  // String | name that need to be deleted
-            var body = new User(); // User | Updated user object
-
-            try
-            {
-                // Updated user
-                apiInstance.updateUser(username, body);
-            }
-            catch (Exception e)
-            {
-                Debug.Print("Exception when calling UserApi.updateUser: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-$api_instance = new Swagger\Client\Api\UserApi();
-$username = username_example; // String | name that need to be deleted
-$body = ; // User | Updated user object
-
-try {
-    $api_instance->updateUser($username, $body);
-} catch (Exception $e) {
-    echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | name that need to be deleted
-my $body = WWW::SwaggerClient::Object::User->new(); # User | Updated user object
-
-eval { 
-    $api_instance->updateUser(username => $username, body => $body);
-};
-if ($@) {
-    warn "Exception when calling UserApi->updateUser: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | name that need to be deleted
-body =  # User | Updated user object
-
-try: 
-    # Updated user
-    api_instance.updateUser(username, body)
-except ApiException as e:
-    print("Exception when calling UserApi->updateUser: %s\n" % e)
-
-

Parameters

-
Path parameters
@@ -7293,7 +3157,7 @@ except ApiException as e:
- Generated 2017-03-02T21:09:32.930+01:00 + Generated 2017-03-04T14:14:43.027Z
From f72340fb17f52665cf03b9906dc42a85ba64eb13 Mon Sep 17 00:00:00 2001 From: Johannes Fiala Date: Sun, 5 Mar 2017 19:17:27 +0100 Subject: [PATCH 064/132] change jackson jaxrs version to 2.8.4 #4924 --- .../src/main/resources/JavaJaxRS/cxf/server/pom.mustache | 2 +- samples/server/petstore/jaxrs-cxf/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 6aca3eab56d..ec2559bd6db 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -245,7 +245,7 @@ 1.3.3.RELEASE {{/generateSpringBootApplication}} 3.1.8 - 2.4.5 + 2.8.4 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 3b4ff93c27e..59b8b3545d8 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -192,7 +192,7 @@ 2.5 1.1.0.Final 3.1.8 - 2.4.5 + 2.8.4 UTF-8 From 6c9b0ce257e31a0dde54846cbf0a6ae2241b150b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Mon, 6 Mar 2017 07:23:02 +0100 Subject: [PATCH 065/132] Update samples for Scalatra after 2.2.2. (#4910) * Update samples for Scalatra after 2.2.2. * [scalatra] Revert changes to build.sbt Changes were made in conjunction with the new finch generator. This reverts those changes to Scalatra's previous build.sbt. * Update scalatra samples again after revert of part of #3905. --- .../src/main/resources/scalatra/build.sbt | 26 ++++++++++++------- .../scala/com/wordnik/client/api/PetApi.scala | 8 +++--- .../com/wordnik/client/api/StoreApi.scala | 4 +-- .../com/wordnik/client/api/UserApi.scala | 3 +++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt index 9dc3cff3596..00575312d85 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt @@ -23,12 +23,23 @@ scalaVersion := "2.11.2" scalacOptions += "-language:postfixOps" libraryDependencies ++= Seq( - "com.github.finagle" %% "finch-core" % "0.9.2-SNAPSHOT" changing(), - "com.github.finagle" %% "finch-argonaut" % "0.9.2-SNAPSHOT" changing(), - "io.argonaut" %% "argonaut" % "6.1", - "com.github.finagle" %% "finch-test" % "0.9.2-SNAPSHOT" % "test,it" changing(), - "org.scalacheck" %% "scalacheck" % "1.12.5" % "test,it", - "org.scalatest" %% "scalatest" % "2.2.5" % "test,it" + "org.scalatest" %% "scalatest" % "2.2.1" % "test", + "org.scalatra" %% "scalatra" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", + "org.json4s" %% "json4s-jackson" % "3.2.10", + "org.json4s" %% "json4s-ext" % "3.2.10", + "commons-codec" % "commons-codec" % "1.7", + "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", + //"net.databinder.dispatch" %% "json4s-jackson" % "0.11.2", + "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", + "com.typesafe.akka" %% "akka-actor" % "2.3.6", + "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) ) resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" @@ -37,9 +48,6 @@ resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/reposi resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" -resolvers += "TM" at "http://maven.twttr.com" - - ivyXML := diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala index 2353b35ff76..7c6d352ae5d 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala @@ -63,7 +63,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[Long]("petId").description(""), headerParam[String]("apiKey").description("").optional) ) - delete("/pet/{petId}",operation(deletePetOperation)) { + delete("/pet/:petId",operation(deletePetOperation)) { val petId = params.getOrElse("petId", halt(400)) @@ -131,7 +131,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[Long]("petId").description("")) ) - get("/pet/{petId}",operation(getPetByIdOperation)) { + get("/pet/:petId",operation(getPetByIdOperation)) { val petId = params.getOrElse("petId", halt(400)) @@ -161,7 +161,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[Long]("petId").description(""), formParam[String]("name").description("").optional, formParam[String]("status").description("").optional) ) - post("/pet/{petId}",operation(updatePetWithFormOperation)) { + post("/pet/:petId",operation(updatePetWithFormOperation)) { val petId = params.getOrElse("petId", halt(400)) @@ -186,7 +186,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[Long]("petId").description(""), formParam[String]("additionalMetadata").description("").optional, formParam[File]("file").description("").optional) ) - post("/pet/{petId}/uploadImage",operation(uploadFileOperation)) { + post("/pet/:petId/uploadImage",operation(uploadFileOperation)) { val petId = params.getOrElse("petId", halt(400)) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala index 44e41f4d1e8..58af1ba24f5 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala @@ -46,7 +46,7 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[String]("orderId").description("")) ) - delete("/store/order/{orderId}",operation(deleteOrderOperation)) { + delete("/store/order/:orderId",operation(deleteOrderOperation)) { val orderId = params.getOrElse("orderId", halt(400)) @@ -71,7 +71,7 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet parameters(pathParam[Long]("orderId").description("")) ) - get("/store/order/{orderId}",operation(getOrderByIdOperation)) { + get("/store/order/:orderId",operation(getOrderByIdOperation)) { val orderId = params.getOrElse("orderId", halt(400)) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala index 8b8630675b1..8dfcc672c26 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala @@ -93,6 +93,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet delete("/user/:username",operation(deleteUserOperation)) { + val username = params.getOrElse("username", halt(400)) println("username: " + username) @@ -107,6 +108,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet get("/user/:username",operation(getUserByNameOperation)) { + val username = params.getOrElse("username", halt(400)) println("username: " + username) @@ -151,6 +153,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet put("/user/:username",operation(updateUserOperation)) { + val username = params.getOrElse("username", halt(400)) println("username: " + username) From 899ef8f1efbc0c0c0f630e14f0c51bbf82e7331e Mon Sep 17 00:00:00 2001 From: Matan Rubin Date: Mon, 6 Mar 2017 08:25:15 +0200 Subject: [PATCH 066/132] [JAXRS-CXF] [bug #4422] use java.util.Date when selecting dateLibrary=legacy (#4724) according to the help message setting dateLibrary to 'legacy' should make the code generator use java.util.Date. before this change, when setting dateLibrary to 'legacy' made the generator use javax.xml.datatype.XMLGregorianCalendar. now, the generator uses java.util.Date such that the documentation and behavior are consistent. --- .../languages/JavaCXFClientCodegen.java | 51 +++++++++---------- .../languages/JavaCXFServerCodegen.java | 1 - .../languages/JavaJAXRSSpecServerCodegen.java | 27 +++++----- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java index d1c9d41ae31..214b73e0e29 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java @@ -21,30 +21,30 @@ import io.swagger.codegen.languages.features.LoggingTestFeatures; import io.swagger.models.Operation; public class JavaCXFClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures -{ + implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures +{ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); - + /** * Name of the sub-directory in "src/main/resource" where to find the * Mustache template for the JAX-RS Codegen. */ protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS"; - + protected boolean useJaxbAnnotations = true; protected boolean useBeanValidation = false; - + protected boolean useGzipFeatureForTests = false; - + protected boolean useLoggingFeatureForTests = false; - + public JavaCXFClientCodegen() { super(); supportsInheritance = true; - + sourceFolder = "src/gen/java"; invokerPackage = "io.swagger.api"; artifactId = "swagger-jaxrs-client"; @@ -52,9 +52,9 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen apiPackage = "io.swagger.api"; modelPackage = "io.swagger.model"; - + outputFolder = "generated-code/JavaJaxRS-CXF"; - + // clear model and api doc template as this codegen // does not support auto-generated markdown doc at the moment //TODO: add doc templates @@ -63,7 +63,6 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); @@ -72,11 +71,11 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_JAXB_ANNOTATIONS, "Use JAXB annotations for XML")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); - + cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests")); cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests")); - - + + } @@ -84,7 +83,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen public void processOpts() { super.processOpts(); - + if (additionalProperties.containsKey(USE_JAXB_ANNOTATIONS)) { boolean useJaxbAnnotationsProp = convertPropertyToBooleanAndWriteBack(USE_JAXB_ANNOTATIONS); this.setUseJaxbAnnotations(useJaxbAnnotationsProp); @@ -94,15 +93,15 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION); this.setUseBeanValidation(useBeanValidationProp); } - + this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); - - + + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen - + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); - + } @Override @@ -117,13 +116,13 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen { return CodegenType.CLIENT; } - + @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - super.addOperationToGroup(tag, resourcePath, operation, co, operations); + super.addOperationToGroup(tag, resourcePath, operation, co, operations); co.subresourceOperation = !co.path.isEmpty(); } - + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -132,17 +131,17 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen model.imports.remove("JsonSerialize"); model.imports.remove("ToStringSerializer"); } - + @Override public String getHelp() { return "Generates a Java JAXRS Client based on Apache CXF framework."; } - + public void setUseBeanValidation(boolean useBeanValidation) { this.useBeanValidation = useBeanValidation; } - + public void setUseJaxbAnnotations(boolean useJaxbAnnotations) { this.useJaxbAnnotations = useJaxbAnnotations; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java index 720cbc49331..8c1b012ba62 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java @@ -78,7 +78,6 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java index 6c91e175db5..55b2b87da64 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -21,9 +21,9 @@ import io.swagger.models.Swagger; import io.swagger.models.properties.Property; import io.swagger.util.Json; -public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen -{ - +public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen +{ + public JavaJAXRSSpecServerCodegen() { super(); @@ -48,7 +48,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen additionalProperties.put("title", title); typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); @@ -60,7 +59,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen break; } } - + CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); library.setDefault(DEFAULT_LIBRARY); @@ -71,20 +70,20 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen cliOptions.add(library); } - + @Override public void processOpts() { super.processOpts(); - + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); - + writeOptional(outputFolder, new SupportingFile("RestApplication.mustache", (sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")); - - } - + + } + @Override public String getName() @@ -119,7 +118,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen opList.add(co); co.baseName = basePath; } - + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -130,10 +129,10 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen model.imports.remove("JsonValue"); model.imports.remove("JsonProperty"); } - + @Override public void preprocessSwagger(Swagger swagger) { - //copy input swagger to output folder + //copy input swagger to output folder try { String swaggerJson = Json.pretty(swagger); FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); From e477ac94729bcf98a70d692636aa2feec0ba5917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Mon, 6 Mar 2017 07:47:52 +0100 Subject: [PATCH 067/132] Fix #4898 for spring-cloud. (#4919) Somehow I omitted this in #4875. --- .../JavaSpring/libraries/spring-cloud/formParams.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index e7547a3ba19..bd2cb8bb640 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{paramName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("{{baseName}}") MultipartFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file From 5d327e66a188fbfbd10a549b681b6167d8173027 Mon Sep 17 00:00:00 2001 From: Paul English Date: Sun, 5 Mar 2017 23:50:21 -0700 Subject: [PATCH 068/132] Port the optional/enum template logic from async-scala to the regular scala client (#4849) * Port the optional/enum template logic from async-scala to the regular scala client * oops, accidently pulled template from akka-scala which has custom logic for enum Just going to avoid enum for now, considering I'm not sure what scala client will be official * Update tests to use option --- .../src/main/resources/scala/model.mustache | 3 +- .../io/swagger/client/model/ApiResponse.scala | 7 +- .../io/swagger/client/model/Category.scala | 5 +- .../scala/io/swagger/client/model/Order.scala | 13 +-- .../scala/io/swagger/client/model/Pet.scala | 9 +- .../scala/io/swagger/client/model/Tag.scala | 5 +- .../scala/io/swagger/client/model/User.scala | 17 ++-- .../scala/src/test/scala/PetApiTest.scala | 34 +++---- .../scala/src/test/scala/StoreApiTest.scala | 34 +++---- .../scala/src/test/scala/UserApiTest.scala | 96 +++++++++---------- 10 files changed, 115 insertions(+), 108 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scala/model.mustache b/modules/swagger-codegen/src/main/resources/scala/model.mustache index b6920ae9fd4..12b635bfb3e 100644 --- a/modules/swagger-codegen/src/main/resources/scala/model.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/model.mustache @@ -12,8 +12,9 @@ case class {{classname}} ( {{#description}} /* {{{description}}} */ {{/description}} - {{name}}: {{{datatype}}}{{#hasMore}},{{/hasMore}} + {{{name}}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}} {{/vars}} ) + {{/model}} {{/models}} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala index 7ddb74d163f..a2badb49ae1 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala @@ -14,7 +14,8 @@ package io.swagger.client.model case class ApiResponse ( - code: Integer, - _type: String, - message: String + code: Option[Integer], + _type: Option[String], + message: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala index 8ec37098e1b..e39d097b918 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala @@ -14,6 +14,7 @@ package io.swagger.client.model case class Category ( - id: Long, - name: String + id: Option[Long], + name: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala index 446455f7657..a88c0ec23d9 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala @@ -15,11 +15,12 @@ package io.swagger.client.model import org.joda.time.DateTime case class Order ( - id: Long, - petId: Long, - quantity: Integer, - shipDate: DateTime, + id: Option[Long], + petId: Option[Long], + quantity: Option[Integer], + shipDate: Option[DateTime], /* Order Status */ - status: String, - complete: Boolean + status: Option[String], + complete: Option[Boolean] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala index fcf1a205081..baabc18c99f 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala @@ -14,11 +14,12 @@ package io.swagger.client.model case class Pet ( - id: Long, - category: Category, + id: Option[Long], + category: Option[Category], name: String, photoUrls: List[String], - tags: List[Tag], + tags: Option[List[Tag]], /* pet status in the store */ - status: String + status: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala index 8abb53e0903..5ae718fd7e8 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala @@ -14,6 +14,7 @@ package io.swagger.client.model case class Tag ( - id: Long, - name: String + id: Option[Long], + name: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala index 30f58e19b7e..c5bdb386638 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala @@ -14,13 +14,14 @@ package io.swagger.client.model case class User ( - id: Long, - username: String, - firstName: String, - lastName: String, - email: String, - password: String, - phone: String, + id: Option[Long], + username: Option[String], + firstName: Option[String], + lastName: Option[String], + email: Option[String], + password: Option[String], + phone: Option[String], /* User Status */ - userStatus: Integer + userStatus: Option[Integer] ) + diff --git a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala index 426df5871ac..b5ae542a5fe 100644 --- a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala @@ -17,22 +17,22 @@ class PetApiTest extends FlatSpec with Matchers { it should "add and fetch a pet" in { val pet = Pet( - 1000, - Category(1, "sold"), + Some(1000), + Some(Category(Some(1), Some("sold"))), "dragon", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, - "lost" + Some((for (i <- (1 to 5)) yield io.swagger.client.model.Tag(Some(i), Some("tag-" + i))).toList), + Some("lost") ) api.addPet(pet) api.getPetById(1000) match { case Some(pet) => { - pet.id should be(1000) - pet.tags.size should be(5) - pet.status should be("lost") + pet.id should be(Some(1000)) + pet.tags.get.size should be(5) + pet.status should be(Some("lost")) pet.category should not be (null) - pet.category.name should be("sold") + pet.category.get.name should be(Some("sold")) pet.name should be("dragon") pet.photoUrls.size should be(10) } @@ -42,12 +42,12 @@ class PetApiTest extends FlatSpec with Matchers { it should "update a pet" in { val pet = Pet( - 1000, - Category(1, "sold"), + Some(1000), + Some(Category(Some(1), Some("sold"))), "programmer", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, - "confused" + Some((for (i <- (1 to 5)) yield io.swagger.client.model.Tag(Some(i), Some("tag-" + i))).toList), + Some("confused") ) api.addPet(pet) @@ -55,16 +55,16 @@ class PetApiTest extends FlatSpec with Matchers { api.getPetById(1000) match { case Some(pet) => { pet.name should be("programmer") - pet.status should be("confused") + pet.status should be(Some("confused")) } case None => fail("didn't find pet created") } - val updatedPet = pet.copy(status = "fulfilled") + val updatedPet = pet.copy(status = Some("fulfilled")) api.updatePet(updatedPet) api.getPetById(1000) match { case Some(pet) => { pet.name should be("programmer") - pet.status should be("fulfilled") + pet.status should be(Some("fulfilled")) } case None => fail("didn't find pet updated") } @@ -83,8 +83,8 @@ class PetApiTest extends FlatSpec with Matchers { api.findPetsByTags(List("tag1", "tag2")) match { case Some(pets) => { pets.foreach(pet => { - val tags = (for (tag <- pet.tags) yield tag.name).toSet - if ((tags & Set("tag1", "tag2")).size == 0) + val tags = (for (tag <- pet.tags.get) yield tag.name).toSet + if ((tags & Set(Some("tag1"), Some("tag2"))).size == 0) fail("unexpected tags in " + tags) }) } diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala index b0eac1af66e..4c1a06f1cb6 100644 --- a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala @@ -20,22 +20,22 @@ class StoreApiTest extends FlatSpec with Matchers { it should "place and fetch an order" in { val now = new org.joda.time.DateTime val order = Order( - petId = 10, - id = 1000, - quantity = 101, - status = "pending", - shipDate = now, - complete = true) + petId = Some(10), + id = Some(1000), + quantity = Some(101), + status = Some("pending"), + shipDate = Some(now), + complete = Some(true)) api.placeOrder(order) api.getOrderById(1000) match { case Some(order) => { - order.id should be(1000) - order.petId should be(10) - order.quantity should be(101) + order.id should be(Some(1000)) + order.petId should be(Some(10)) + order.quantity should be(Some(101)) // use `getMillis` to compare across timezones - order.shipDate.getMillis.equals(now.getMillis) should be(true) + order.shipDate.get.getMillis.equals(now.getMillis) should be(true) } case None => fail("didn't find order created") } @@ -44,17 +44,17 @@ class StoreApiTest extends FlatSpec with Matchers { it should "delete an order" in { val now = new org.joda.time.DateTime val order = Order( - id = 1001, - petId = 10, - quantity = 101, - status = "pending", - shipDate = now, - complete = true) + id = Some(1001), + petId = Some(10), + quantity = Some(101), + status = Some("pending"), + shipDate = Some(now), + complete = Some(true)) api.placeOrder(order) api.getOrderById(1001) match { - case Some(order) => order.id should be(1001) + case Some(order) => order.id should be(Some(1001)) case None => fail("didn't find order created") } diff --git a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala index 77614a5dbbb..b47f7002e96 100644 --- a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala @@ -19,14 +19,14 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { // preparation before running a test override def beforeAll() { val user = User( - 11222, - "scala-test-username", - "scala-test-first", - "scala-test-last", - "scala_test@fail.com", - "SCALATEST", - "408-867-5309", - 1) + Some(11222), + Some("scala-test-username"), + Some("scala-test-first"), + Some("scala-test-last"), + Some("scala_test@fail.com"), + Some("SCALATEST"), + Some("408-867-5309"), + Some(1)) api.createUser(user) } @@ -39,14 +39,14 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "fetch a user" in { api.getUserByName("scala-test-username") match { case Some(user) => { - user.id should be(11222) - user.username should be("scala-test-username") - user.password should be("SCALATEST") - user.email should be("scala_test@fail.com") - user.firstName should be("scala-test-first") - user.lastName should be("scala-test-last") - user.phone should be("408-867-5309") - user.userStatus should be(1) + user.id should be(Some(11222)) + user.username should be(Some("scala-test-username")) + user.password should be(Some("SCALATEST")) + user.email should be(Some("scala_test@fail.com")) + user.firstName should be(Some("scala-test-first")) + user.lastName should be(Some("scala-test-last")) + user.phone should be(Some("408-867-5309")) + user.userStatus should be(Some(1)) } case None => } @@ -69,22 +69,22 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "create 2 users" in { val userArray = (for (i <- (1 to 2)) yield { User( - 2000 + i, - "johnny-" + i, - "Johnny", - "Rocket-" + i, - "johnny-" + i + "@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(2000 + i), + Some("johnny-" + i), + Some("Johnny"), + Some("Rocket-" + i), + Some("johnny-" + i + "@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) }).toList api.createUsersWithArrayInput(userArray) for (i <- (1 to 2)) { api.getUserByName("johnny-" + i) match { case Some(user) => { - user.id should be(2000 + i) - user.email should be("johnny-" + i + "@fail.com") + user.id should be(Some(2000 + i)) + user.email should be(Some("johnny-" + i + "@fail.com")) } case None => fail("didn't find user " + i) } @@ -94,22 +94,22 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "create 3 users" in { val userList = (for (i <- (1 to 3)) yield { User( - 3000 + i, - "fred-" + i, - "Johnny", - "Rocket-" + i, - "fred-" + i + "@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(3000 + i), + Some("fred-" + i), + Some("Johnny"), + Some("Rocket-" + i), + Some("fred-" + i + "@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) }).toList api.createUsersWithListInput(userList) for (i <- (1 to 3)) { api.getUserByName("fred-" + i) match { case Some(user) => { - user.id should be(3000 + i) - user.email should be("fred-" + i + "@fail.com") + user.id should be(Some(3000 + i)) + user.email should be(Some("fred-" + i + "@fail.com")) } case None => fail("didn't find user " + i) } @@ -118,31 +118,31 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "update a user" in { val user = User( - 4000, - "tony", - "Tony", - "Tiger", - "tony@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(4000), + Some("tony"), + Some("Tony"), + Some("Tiger"), + Some("tony@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) api.createUser(user) api.getUserByName("tony") match { case Some(user) => { - user.id should be(4000) - user.username should be("tony") + user.id should be(Some(4000)) + user.username should be(Some("tony")) } case None => } - val updatedUser = user.copy(email = "tony@succeed.com") + val updatedUser = user.copy(email = Some("tony@succeed.com")) api.updateUser("tony", updatedUser) api.getUserByName("tony") match { case Some(user) => { - user.email should be("tony@succeed.com") + user.email should be(Some("tony@succeed.com")) } case None => } From 10950db2ddf80d4bfb38b2a8845987763767b369 Mon Sep 17 00:00:00 2001 From: Zhanwei Wang Date: Mon, 6 Mar 2017 15:01:19 +0800 Subject: [PATCH 069/132] [JavaScript] Do not parse null and undefined as type. (#4933) * [JavaScript] Do not parse null and undefined as type. * update pet store example for #4932 --- .../src/main/resources/Javascript/ApiClient.mustache | 5 ++++- samples/client/petstore/javascript/src/ApiClient.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index 8f49b13a4c8..ffe6c32dc8f 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -452,9 +452,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ {{/emitJSDoc}} exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index f9f2cb06945..c3be4990de9 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -442,9 +442,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); From 4b7a50c6a5077b376f7427cec9b29f635b8e60c9 Mon Sep 17 00:00:00 2001 From: Zhanwei Wang Date: Mon, 6 Mar 2017 16:58:57 +0800 Subject: [PATCH 070/132] Add hashdata to user list (#4935) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 040dfb96713..a5bd8be4e53 100644 --- a/README.md +++ b/README.md @@ -858,6 +858,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) +- [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) From f7b5eb85ce3984e211c26c328d2422e6d6a617eb Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 6 Mar 2017 17:16:41 +0800 Subject: [PATCH 071/132] [Swift] add batch files for swift 2,3 to generate petstore samples (#4934) * add bat files for swift 2,3 to generate petstore samples * remove -t from swift3 batch file * remove -t from swift batch files --- bin/windows/swift-petstore-all.bat | 3 +++ bin/windows/swift-petstore-promisekit.bat | 10 ++++++++++ bin/windows/swift-petstore-rxswift.bat | 10 ++++++++++ bin/windows/swift-petstore.bat | 2 +- bin/windows/swift3-petstore-all.bat | 3 +++ bin/windows/swift3-petstore-promisekit.bat | 10 ++++++++++ bin/windows/swift3-petstore-rxswift.bat | 10 ++++++++++ bin/windows/swift3-petstore.bat | 10 ++++++++++ 8 files changed, 57 insertions(+), 1 deletion(-) create mode 100755 bin/windows/swift-petstore-all.bat create mode 100755 bin/windows/swift-petstore-promisekit.bat create mode 100755 bin/windows/swift-petstore-rxswift.bat create mode 100755 bin/windows/swift3-petstore-all.bat create mode 100755 bin/windows/swift3-petstore-promisekit.bat create mode 100755 bin/windows/swift3-petstore-rxswift.bat create mode 100755 bin/windows/swift3-petstore.bat diff --git a/bin/windows/swift-petstore-all.bat b/bin/windows/swift-petstore-all.bat new file mode 100755 index 00000000000..e837f4c1ec6 --- /dev/null +++ b/bin/windows/swift-petstore-all.bat @@ -0,0 +1,3 @@ +call .\bin\windows\swift-petstore.bat +call .\bin\windows\swift-petstore-promisekit.bat +call .\bin\windows\swift-petstore-rxswift.bat diff --git a/bin/windows/swift-petstore-promisekit.bat b/bin/windows/swift-petstore-promisekit.bat new file mode 100755 index 00000000000..bbd0d4c87b9 --- /dev/null +++ b/bin/windows/swift-petstore-promisekit.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -c bin\swift-petstore-promisekit.json -o samples\client\petstore\swift\promisekit + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift-petstore-rxswift.bat b/bin/windows/swift-petstore-rxswift.bat new file mode 100755 index 00000000000..92d80c3a71b --- /dev/null +++ b/bin/windows/swift-petstore-rxswift.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -c bin\swift-petstore-rxswift.json -o samples\client\petstore\swift\rxswift + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift-petstore.bat b/bin/windows/swift-petstore.bat index b0ef85d695d..3728a8da8ad 100755 --- a/bin/windows/swift-petstore.bat +++ b/bin/windows/swift-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -o samples\client\petstore\swift +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -o samples\client\petstore\swift\default java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore-all.bat b/bin/windows/swift3-petstore-all.bat new file mode 100755 index 00000000000..7f2b6a9b5d9 --- /dev/null +++ b/bin/windows/swift3-petstore-all.bat @@ -0,0 +1,3 @@ +call .\bin\windows\swift3-petstore.bat +call .\bin\windows\swift3-petstore-promisekit.bat +call .\bin\windows\swift3-petstore-rxswift.bat diff --git a/bin/windows/swift3-petstore-promisekit.bat b/bin/windows/swift3-petstore-promisekit.bat new file mode 100755 index 00000000000..658c395e72e --- /dev/null +++ b/bin/windows/swift3-petstore-promisekit.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c bin\swift3-petstore-promisekit.json -o samples\client\petstore\swift3\promisekit + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore-rxswift.bat b/bin/windows/swift3-petstore-rxswift.bat new file mode 100755 index 00000000000..3fa97f55245 --- /dev/null +++ b/bin/windows/swift3-petstore-rxswift.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c bin\swift3-petstore-rxswift.json -o samples\client\petstore\swift3\rxswift + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore.bat b/bin/windows/swift3-petstore.bat new file mode 100755 index 00000000000..a3dbf929b94 --- /dev/null +++ b/bin/windows/swift3-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -o samples\client\petstore\swift3\default + +java %JAVA_OPTS% -jar %executable% %ags% From 2dee8381e8cdca5620acd9b521273055e943bed6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 6 Mar 2017 17:23:32 +0800 Subject: [PATCH 072/132] update petstore sample for swift3 --- .../Classes/Swaggers/APIs/PetAPI.swift | 86 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 74 ++++++++-------- .../Classes/Swaggers/APIs/UserAPI.swift | 44 +++++----- .../Swaggers/AlamofireImplementations.swift | 2 +- .../Classes/Swaggers/APIs/PetAPI.swift | 86 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 74 ++++++++-------- .../Classes/Swaggers/APIs/UserAPI.swift | 44 +++++----- .../Swaggers/AlamofireImplementations.swift | 2 +- .../Classes/Swaggers/APIs/PetAPI.swift | 86 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 74 ++++++++-------- .../Classes/Swaggers/APIs/UserAPI.swift | 44 +++++----- .../Swaggers/AlamofireImplementations.swift | 2 +- 12 files changed, 309 insertions(+), 309 deletions(-) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index d7c89efb5d4..6c9db5c937c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -123,50 +123,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 6 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 6 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -210,50 +210,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 6 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 6 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -297,50 +297,50 @@ open class PetAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -471,7 +471,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 4, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 34b29a24938..b879d5066d6 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -66,7 +66,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 7 }}] - returns: RequestBuilder<[String:Int32]> @@ -102,34 +102,34 @@ open class StoreAPI: APIBase { - GET /store/order/{orderId} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 1, + "quantity" : 7, + "id" : 5, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 1, + "quantity" : 7, + "id" : 5, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -168,34 +168,34 @@ open class StoreAPI: APIBase { - POST /store/order - - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 3, + "quantity" : 1, + "id" : 9, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 3, + "quantity" : 1, + "id" : 9, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 4d1a9a55a33..8ed4814cad9 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -169,40 +169,40 @@ open class UserAPI: APIBase { - GET /user/{username} - - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 0, "phone" : "aeiou", - "id" : 123456789, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 0, "phone" : "aeiou", - "id" : 123456789, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] @@ -245,8 +245,8 @@ open class UserAPI: APIBase { - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] - parameter username: (query) The user name for login - parameter password: (query) The password for login in clear text diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index a332333a295..9ded8f13eb1 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 377b1226203..4368f4954f1 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -176,50 +176,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 1, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 0 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 1, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 0 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -280,50 +280,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 9 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 9 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -384,50 +384,50 @@ open class PetAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 4 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 4 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -613,7 +613,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 0, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 627d3426a87..ee9734a9d68 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -100,7 +100,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 7 }}] - returns: RequestBuilder<[String:Int32]> @@ -153,34 +153,34 @@ open class StoreAPI: APIBase { - GET /store/order/{orderId} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 2, + "quantity" : 9, + "id" : 4, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 2, + "quantity" : 9, + "id" : 4, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -236,34 +236,34 @@ open class StoreAPI: APIBase { - POST /store/order - - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 8, + "quantity" : 2, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 8, + "quantity" : 2, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index c059bb073a7..4a230289485 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -255,40 +255,40 @@ open class UserAPI: APIBase { - GET /user/{username} - - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 9, "phone" : "aeiou", - "id" : 123456789, + "id" : 9, "email" : "aeiou", "username" : "aeiou" }}] - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 9, "phone" : "aeiou", - "id" : 123456789, + "id" : 9, "email" : "aeiou", "username" : "aeiou" }}] @@ -349,8 +349,8 @@ open class UserAPI: APIBase { - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] - parameter username: (query) The user name for login - parameter password: (query) The password for login in clear text diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index a332333a295..9ded8f13eb1 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 65bdf19a7be..540fe41b57c 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -182,50 +182,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 0 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 0 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -288,50 +288,50 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 0 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 4, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 0 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 3 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -394,50 +394,50 @@ open class PetAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 1, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= - 123456 + 123456789 doggie - string + aeiou - string + aeiou }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 1, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -629,7 +629,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 1, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 64fb990ccab..6414443125d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -104,7 +104,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 7 }}] - returns: RequestBuilder<[String:Int32]> @@ -159,34 +159,34 @@ open class StoreAPI: APIBase { - GET /store/order/{orderId} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 0, + "id" : 5, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 0, + "id" : 5, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -244,34 +244,34 @@ open class StoreAPI: APIBase { - POST /store/order - - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 3, + "quantity" : 8, + "id" : 8, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= - 123456 - 123456 - 0 + 123456789 + 123456789 + 123 2000-01-23T04:56:07.000Z - string + aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 3, + "quantity" : 8, + "id" : 8, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 0af45a0d351..9a5081f2f51 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -265,40 +265,40 @@ open class UserAPI: APIBase { - GET /user/{username} - - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 2, "phone" : "aeiou", - "id" : 123456789, + "id" : 4, "email" : "aeiou", "username" : "aeiou" }}] - examples: [{contentType=application/xml, example= - 123456 - string - string - string - string - string - string - 0 + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 }, {contentType=application/json, example={ "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 2, "phone" : "aeiou", - "id" : 123456789, + "id" : 4, "email" : "aeiou", "username" : "aeiou" }}] @@ -361,8 +361,8 @@ open class UserAPI: APIBase { - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] - - examples: [{contentType=application/xml, example=string}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}] - parameter username: (query) The user name for login - parameter password: (query) The password for login in clear text diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index a332333a295..9ded8f13eb1 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): From a710149cdd7066d893ab8917c33af9918e3ae3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Mon, 6 Mar 2017 13:04:31 +0100 Subject: [PATCH 073/132] Fix #4898 for jaxrs (#4918) * fix #4898 for JavaJaxRS (including all libraries). * Updated samples for jaxrs (after fix for #4898). --- .../main/resources/JavaJaxRS/cxf-cdi/formParams.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/formParams.mustache | 2 +- .../src/main/resources/JavaJaxRS/formParams.mustache | 6 +++--- .../JavaJaxRS/libraries/jersey1/formParams.mustache | 4 ++-- .../resources/JavaJaxRS/resteasy/eap/formParams.mustache | 2 +- .../main/resources/JavaJaxRS/resteasy/formParams.mustache | 2 +- .../src/main/resources/JavaJaxRS/spec/formParams.mustache | 4 ++-- .../jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java | 4 ++-- .../jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache index 3bc0dfe132b..3721c1e80ca 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) InputStream {{paramName}}InputStream, @Multipart(value = "{{paramName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) InputStream {{paramName}}InputStream, @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache index f4988929e52..70bbe6409fd 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{paramName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache index 9a7ff6ea6cf..c57c57cd391 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache @@ -1,3 +1,3 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} - @FormDataParam("{{paramName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{paramName}}") FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} + @FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, + @FormDataParam("{{baseName}}") FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache index 62d45ea9fef..bc59f3bf873 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{#notFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}}@FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}}@FormDataParam("{{baseName}}") InputStream inputStream, + @FormDataParam("{{baseName}}") FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache index 09c149b8ade..04f6ed275c8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache index 09c149b8ade..04f6ed275c8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache index e88e3022aa7..931d1abff8b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{#notFile}}@FormParam(value = "{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{paramName}}") InputStream {{paramName}}InputStream, - @FormParam(value = "{{paramName}}") Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}InputStream, + @FormParam(value = "{{baseName}}") Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java index f75305e19f0..235016d8d62 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -34,13 +34,13 @@ public interface FakeApi { @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) - public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "_double") Double _double, @Multipart(value = "patternWithoutDelimiter") String patternWithoutDelimiter, @Multipart(value = "_byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "_float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "paramCallback", required = false) String paramCallback); + public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); @GET @Path("/fake") @Consumes({ "*/*" }) @Produces({ "*/*" }) @ApiOperation(value = "To test enum parameters", tags={ "fake" }) - public void testEnumParameters(@Multipart(value = "enumFormStringArray", required = false) List enumFormStringArray, @Multipart(value = "enumFormString", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enumQueryDouble", required = false) Double enumQueryDouble); + public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java index f8581b82c1b..a0553e646ed 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -42,7 +42,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), @ApiResponse(code = 404, message = "User not found", response = void.class) }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "_double") Double _double,@FormParam(value = "patternWithoutDelimiter") String patternWithoutDelimiter,@FormParam(value = "_byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "_float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password") String password,@FormParam(value = "paramCallback") String paramCallback) { + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { return Response.ok().entity("magic!").build(); } @@ -54,7 +54,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = void.class), @ApiResponse(code = 404, message = "Not found", response = void.class) }) - public Response testEnumParameters(@FormParam(value = "enumFormStringArray") List enumFormStringArray,@FormParam(value = "enumFormString") String enumFormString,@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enumQueryDouble") Double enumQueryDouble) { + public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) { return Response.ok().entity("magic!").build(); } } From 722b96bcecea54fd5fb2308124ab3fe631004d04 Mon Sep 17 00:00:00 2001 From: Egor Masalitin Date: Mon, 6 Mar 2017 17:48:20 +0200 Subject: [PATCH 074/132] In case if basePath equals to / we should not append it to url, behaviour was changed to fit this requirements (#4942) --- .../src/main/java/io/swagger/codegen/DefaultGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index f6983d0340f..6bd8931fc61 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -75,12 +75,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { StringBuilder hostBuilder = new StringBuilder(); hostBuilder.append(getScheme()); hostBuilder.append("://"); - if (swagger.getHost() != null) { + if (!StringUtils.isEmpty(swagger.getHost())) { hostBuilder.append(swagger.getHost()); } else { hostBuilder.append("localhost"); } - if (swagger.getBasePath() != null) { + if (!StringUtils.isEmpty(swagger.getBasePath()) && !swagger.getBasePath().equals("/")) { hostBuilder.append(swagger.getBasePath()); } return hostBuilder.toString(); From ab4c5f200382099740515a2e567b89c97c684806 Mon Sep 17 00:00:00 2001 From: Josiah Peters Date: Mon, 6 Mar 2017 09:11:40 -0700 Subject: [PATCH 075/132] Updated readme with latest maven URL (#4945) Changed the direct download link for swagger-codegen-cli jar that is hosted in Maven from the previous releases file to the latest one. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5bd8be4e53..51e65473e75 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar ) +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` From 122194c30ee594837a9240fa18421c0bfe31a46d Mon Sep 17 00:00:00 2001 From: Val Polouchkine Date: Mon, 6 Mar 2017 21:49:42 -0800 Subject: [PATCH 076/132] Fix typo (#4956) Authorizatoin should be Authorization --- modules/swagger-codegen/src/main/resources/Java/README.mustache | 2 +- .../swagger-codegen/src/main/resources/android/README.mustache | 2 +- modules/swagger-codegen/src/main/resources/go/README.mustache | 2 +- samples/client/petstore-security-test/go/README.md | 2 +- .../client/petstore-security-test/java/okhttp-gson/README.md | 2 +- samples/client/petstore/android/httpclient/README.md | 2 +- samples/client/petstore/android/volley/README.md | 2 +- samples/client/petstore/go/go-petstore/README.md | 2 +- samples/client/petstore/java/jersey1/README.md | 2 +- samples/client/petstore/java/jersey2-java6/README.md | 2 +- samples/client/petstore/java/jersey2-java8/README.md | 2 +- samples/client/petstore/java/jersey2/README.md | 2 +- .../client/petstore/java/okhttp-gson-parcelableModel/README.md | 2 +- samples/client/petstore/java/okhttp-gson/README.md | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/README.mustache b/modules/swagger-codegen/src/main/resources/Java/README.mustache index 17d2a93d43c..fff0bf0973c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/README.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/README.mustache @@ -130,7 +130,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} -- **Authorizatoin URL**: {{authorizationUrl}} +- **Authorization URL**: {{authorizationUrl}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - {{scope}}: {{description}} {{/scopes}} diff --git a/modules/swagger-codegen/src/main/resources/android/README.mustache b/modules/swagger-codegen/src/main/resources/android/README.mustache index 4834927cd51..b51ea005757 100644 --- a/modules/swagger-codegen/src/main/resources/android/README.mustache +++ b/modules/swagger-codegen/src/main/resources/android/README.mustache @@ -107,7 +107,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} -- **Authorizatoin URL**: {{authorizationUrl}} +- **Authorization URL**: {{authorizationUrl}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - {{scope}}: {{description}} {{/scopes}} diff --git a/modules/swagger-codegen/src/main/resources/go/README.mustache b/modules/swagger-codegen/src/main/resources/go/README.mustache index 0cfe5bfcae3..190beb68810 100644 --- a/modules/swagger-codegen/src/main/resources/go/README.mustache +++ b/modules/swagger-codegen/src/main/resources/go/README.mustache @@ -51,7 +51,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{{flow}}} -- **Authorizatoin URL**: {{{authorizationUrl}}} +- **Authorization URL**: {{{authorizationUrl}}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - **{{{scope}}}**: {{{description}}} {{/scopes}} diff --git a/samples/client/petstore-security-test/go/README.md b/samples/client/petstore-security-test/go/README.md index 965b0aca530..c35db5c71ca 100644 --- a/samples/client/petstore-security-test/go/README.md +++ b/samples/client/petstore-security-test/go/README.md @@ -43,7 +43,7 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - **write:pets**: modify pets in your account */ ' " =end \r\n \n \r - **read:pets**: read your pets */ ' " =end \r\n \n \r diff --git a/samples/client/petstore-security-test/java/okhttp-gson/README.md b/samples/client/petstore-security-test/java/okhttp-gson/README.md index ad16d5e8641..63efd69e9b8 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/README.md +++ b/samples/client/petstore-security-test/java/okhttp-gson/README.md @@ -110,7 +110,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account */ ' " =end - read:pets: read your pets */ ' " =end diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 3c9dcf27af0..576d718f1f1 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -126,7 +126,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c92f468b12b..0b51769d921 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -126,7 +126,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 265cd850ed9..6a5005e3df2 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -99,7 +99,7 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - **write:pets**: modify pets in your account - **read:pets**: read your pets diff --git a/samples/client/petstore/java/jersey1/README.md b/samples/client/petstore/java/jersey1/README.md index c824c828980..264fe34c81a 100644 --- a/samples/client/petstore/java/jersey1/README.md +++ b/samples/client/petstore/java/jersey1/README.md @@ -167,7 +167,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md index 115ac085d74..ea5261dff95 100644 --- a/samples/client/petstore/java/jersey2-java6/README.md +++ b/samples/client/petstore/java/jersey2-java6/README.md @@ -164,7 +164,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2-java8/README.md b/samples/client/petstore/java/jersey2-java8/README.md index 579d98c8224..78f4711d060 100644 --- a/samples/client/petstore/java/jersey2-java8/README.md +++ b/samples/client/petstore/java/jersey2-java8/README.md @@ -155,7 +155,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md index 6b6db099581..a1088603f3f 100644 --- a/samples/client/petstore/java/jersey2/README.md +++ b/samples/client/petstore/java/jersey2/README.md @@ -146,7 +146,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index 8266ae87a9c..ce4c6f54fa4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md @@ -167,7 +167,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index f2b11d703c2..541407fec8b 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -149,7 +149,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets From 7de1eeb987b9ae04460f78fe86f32a1bd4f01be7 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Tue, 7 Mar 2017 07:46:38 +0100 Subject: [PATCH 077/132] [python] Triple quote strings with new lines in default values (#4941) * Triple quote python strings in defaults When the model contains a string with a default value with new lines in it, simply quoting generates invalid python code. Using triple quotes for all string defaults makes sure the generated code will be a valid python string. Fixes #4862 * Wrap default string in triple quotes when it contains new lines * Add newly generated python sample files --- .../io/swagger/codegen/languages/PythonClientCodegen.java | 6 +++++- .../python/petstore_api/api_client.py | 2 +- .../client/petstore-security-test/python/requirements.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 38e4a75491c..5c0aa0a7916 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; @@ -519,7 +520,10 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig if (p instanceof StringProperty) { StringProperty dp = (StringProperty) p; if (dp.getDefault() != null) { - return "'" + dp.getDefault() + "'"; + if (Pattern.compile("\r\n|\r|\n").matcher(dp.getDefault()).find()) + return "'''" + dp.getDefault() + "'''"; + else + return "'" + dp.getDefault() + "'"; } } else if (p instanceof BooleanProperty) { BooleanProperty dp = (BooleanProperty) p; diff --git a/samples/client/petstore-security-test/python/petstore_api/api_client.py b/samples/client/petstore-security-test/python/petstore_api/api_client.py index f8b73bc1463..95265e49715 100644 --- a/samples/client/petstore-security-test/python/petstore_api/api_client.py +++ b/samples/client/petstore-security-test/python/petstore_api/api_client.py @@ -116,7 +116,7 @@ class ApiClient(object): collection_formats) for k, v in path_params: resource_path = resource_path.replace( - '{%s}' % k, quote(str(v), safe="")) + '{%s}' % k, quote(str(v), safe='')) # no safe chars, encode everything # query parameters if query_params: diff --git a/samples/client/petstore-security-test/python/requirements.txt b/samples/client/petstore-security-test/python/requirements.txt index f00e08fa339..bafdc07532f 100644 --- a/samples/client/petstore-security-test/python/requirements.txt +++ b/samples/client/petstore-security-test/python/requirements.txt @@ -1,5 +1,5 @@ certifi >= 14.05.14 -six == 1.8.0 +six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 From 6ea3315b3eb10dbc145e7adf0a3456b7753480fa Mon Sep 17 00:00:00 2001 From: dhuning Date: Tue, 7 Mar 2017 07:54:15 +0100 Subject: [PATCH 078/132] Implicit headers for SpringCodegen (#4858) * Add a new option implicitHeaders with default false * Change JavaSpring templates and codegen to handle implicit headers * Add script to generate sample for implicitHeader option * Add generated implicitHeader sample * Fix alignment --- ...gboot-petstore-server-implicitHeaders.json | 3 + ...ingboot-petstore-server-implicitHeaders.sh | 34 ++ .../codegen/languages/SpringCodegen.java | 40 +- .../main/resources/JavaSpring/api.mustache | 6 +- .../JavaSpring/implicitHeader.mustache | 1 + .../options/SpringOptionsProvider.java | 2 + .../codegen/spring/SpringOptionsTest.java | 3 +- .../.swagger-codegen-ignore | 23 ++ .../springboot-implicitHeaders/README.md | 18 + .../springboot-implicitHeaders/pom.xml | 73 ++++ .../java/io/swagger/RFC3339DateFormat.java | 20 + .../java/io/swagger/Swagger2SpringBoot.java | 36 ++ .../java/io/swagger/api/ApiException.java | 10 + .../java/io/swagger/api/ApiOriginFilter.java | 27 ++ .../io/swagger/api/ApiResponseMessage.java | 69 ++++ .../src/main/java/io/swagger/api/FakeApi.java | 67 +++ .../io/swagger/api/FakeApiController.java | 62 +++ .../io/swagger/api/NotFoundException.java | 10 + .../src/main/java/io/swagger/api/PetApi.java | 166 ++++++++ .../java/io/swagger/api/PetApiController.java | 72 ++++ .../main/java/io/swagger/api/StoreApi.java | 76 ++++ .../io/swagger/api/StoreApiController.java | 47 +++ .../src/main/java/io/swagger/api/UserApi.java | 123 ++++++ .../io/swagger/api/UserApiController.java | 69 ++++ .../swagger/configuration/HomeController.java | 16 + .../SwaggerDocumentationConfig.java | 40 ++ .../model/AdditionalPropertiesClass.java | 110 +++++ .../main/java/io/swagger/model/Animal.java | 105 +++++ .../java/io/swagger/model/AnimalFarm.java | 50 +++ .../model/ArrayOfArrayOfNumberOnly.java | 82 ++++ .../io/swagger/model/ArrayOfNumberOnly.java | 82 ++++ .../main/java/io/swagger/model/ArrayTest.java | 138 +++++++ .../java/io/swagger/model/Capitalization.java | 189 +++++++++ .../src/main/java/io/swagger/model/Cat.java | 76 ++++ .../main/java/io/swagger/model/Category.java | 97 +++++ .../java/io/swagger/model/ClassModel.java | 75 ++++ .../main/java/io/swagger/model/Client.java | 74 ++++ .../src/main/java/io/swagger/model/Dog.java | 76 ++++ .../java/io/swagger/model/EnumArrays.java | 167 ++++++++ .../main/java/io/swagger/model/EnumClass.java | 41 ++ .../main/java/io/swagger/model/EnumTest.java | 240 +++++++++++ .../java/io/swagger/model/FormatTest.java | 380 ++++++++++++++++++ .../io/swagger/model/HasOnlyReadOnly.java | 97 +++++ .../main/java/io/swagger/model/MapTest.java | 142 +++++++ ...ropertiesAndAdditionalPropertiesClass.java | 131 ++++++ .../io/swagger/model/Model200Response.java | 98 +++++ .../io/swagger/model/ModelApiResponse.java | 120 ++++++ .../java/io/swagger/model/ModelReturn.java | 75 ++++ .../src/main/java/io/swagger/model/Name.java | 145 +++++++ .../java/io/swagger/model/NumberOnly.java | 75 ++++ .../src/main/java/io/swagger/model/Order.java | 224 +++++++++++ .../main/java/io/swagger/model/OuterEnum.java | 41 ++ .../src/main/java/io/swagger/model/Pet.java | 239 +++++++++++ .../java/io/swagger/model/ReadOnlyFirst.java | 97 +++++ .../io/swagger/model/SpecialModelName.java | 74 ++++ .../src/main/java/io/swagger/model/Tag.java | 97 +++++ .../src/main/java/io/swagger/model/User.java | 235 +++++++++++ .../src/main/resources/application.properties | 5 + 58 files changed, 4985 insertions(+), 5 deletions(-) create mode 100755 bin/springboot-petstore-server-implicitHeaders.json create mode 100755 bin/springboot-petstore-server-implicitHeaders.sh create mode 100644 modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache create mode 100644 samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore create mode 100644 samples/server/petstore/springboot-implicitHeaders/README.md create mode 100644 samples/server/petstore/springboot-implicitHeaders/pom.xml create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties diff --git a/bin/springboot-petstore-server-implicitHeaders.json b/bin/springboot-petstore-server-implicitHeaders.json new file mode 100755 index 00000000000..8b76ddb5d26 --- /dev/null +++ b/bin/springboot-petstore-server-implicitHeaders.json @@ -0,0 +1,3 @@ +{ + "implicitHeaders": true +} \ No newline at end of file diff --git a/bin/springboot-petstore-server-implicitHeaders.sh b/bin/springboot-petstore-server-implicitHeaders.sh new file mode 100755 index 00000000000..98e20af9d61 --- /dev/null +++ b/bin/springboot-petstore-server-implicitHeaders.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaSpring -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l spring -c bin/springboot-petstore-server-implicitHeaders.json -o samples/server/petstore/springboot-implicitHeaders -DhideGenerationTimestamp=true" + +echo "Removing files and folders under samples/server/petstore/springboot-implicitHeaders/src/main" +rm -rf samples/server/petstore/springboot-implicitHeaders/src/main +find samples/server/petstore/springboot-implicitHeaders -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java index f735ef7d555..9616f4f11ad 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java @@ -23,6 +23,7 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation public static final String USE_TAGS = "useTags"; public static final String SPRING_MVC_LIBRARY = "spring-mvc"; public static final String SPRING_CLOUD_LIBRARY = "spring-cloud"; + public static final String IMPLICIT_HEADERS = "implicitHeaders"; protected String title = "swagger-petstore"; protected String configPackage = "io.swagger.configuration"; @@ -34,7 +35,8 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation protected boolean async = false; protected String responseWrapper = ""; protected boolean useTags = false; - protected boolean useBeanValidation = true; + protected boolean useBeanValidation = true; + protected boolean implicitHeaders = false; public SpringCodegen() { super(); @@ -63,6 +65,7 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)")); cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Use of @ApiImplicitParams for headers.")); supportedLibraries.put(DEFAULT_LIBRARY, "Spring-boot Server application using the SpringFox integration."); supportedLibraries.put(SPRING_MVC_LIBRARY, "Spring-MVC Server application using the SpringFox integration."); @@ -149,6 +152,11 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation writePropertyBack(USE_BEANVALIDATION, useBeanValidation); } + + if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { + this.setImplicitHeaders(Boolean.valueOf(additionalProperties.get(IMPLICIT_HEADERS).toString())); + } + supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); @@ -388,12 +396,36 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation operation.returnContainer = "Set"; } } + + if(implicitHeaders){ + removeHeadersFromAllParams(operation.allParams); + } } } return objs; } + /** + * This method removes header parameters from the list of parameters and also + * corrects last allParams hasMore state. + * @param allParams list of all parameters + */ + private void removeHeadersFromAllParams(List allParams) { + if(allParams.isEmpty()){ + return; + } + final ArrayList copy = new ArrayList<>(allParams); + allParams.clear(); + + for(CodegenParameter p : copy){ + if(!p.isHeaderParam){ + allParams.add(p); + } + } + allParams.get(allParams.size()-1).hasMore =false; + } + @Override public Map postProcessSupportingFileData(Map objs) { if(library.equals(SPRING_CLOUD_LIBRARY)) { @@ -446,6 +478,10 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation this.useTags = useTags; } + public void setImplicitHeaders(boolean implicitHeaders) { + this.implicitHeaders = implicitHeaders; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -495,4 +531,4 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation this.useBeanValidation = useBeanValidation; } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 5df0cdee1b4..327e5c03f78 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -39,14 +39,16 @@ public interface {{classname}} { }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} }) + {{#implicitHeaders}}@ApiImplicitParams({ + {{#headerParams}}{{>implicitHeader}}{{/headerParams}} + }){{/implicitHeaders}} @RequestMapping(value = "{{{path}}}",{{#singleContentTypes}} produces = "{{{vendorExtensions.x-accepts}}}", consumes = "{{{vendorExtensions.x-contentType}}}",{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}} produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}} consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}} method = RequestMethod.{{httpMethod}}) - {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, - {{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { + {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { // do some magic! return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; }{{/jdk8}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache new file mode 100644 index 00000000000..64d7af20808 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required=true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{#hasMore}},{{/hasMore}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java index 3bad178c416..6387d49f144 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java @@ -19,6 +19,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider { public static final String RESPONSE_WRAPPER = "Callable"; public static final String USE_TAGS = "useTags"; public static final String USE_BEANVALIDATION = "false"; + public static final String IMPLICIT_HEADERS = "false"; @Override public String getLanguage() { @@ -40,6 +41,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider { options.put(SpringCodegen.RESPONSE_WRAPPER, RESPONSE_WRAPPER); options.put(SpringCodegen.USE_TAGS, USE_TAGS); options.put(SpringCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + options.put(SpringCodegen.IMPLICIT_HEADERS, IMPLICIT_HEADERS); return options; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java index b69f958aef5..606f1947f9e 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java @@ -72,7 +72,8 @@ public class SpringOptionsTest extends JavaClientOptionsTest { times = 1; clientCodegen.setUseBeanValidation(Boolean.valueOf(SpringOptionsProvider.USE_BEANVALIDATION)); times = 1; - + clientCodegen.setImplicitHeaders(Boolean.valueOf(SpringOptionsProvider.IMPLICIT_HEADERS)); + times = 1; }}; } } \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/springboot-implicitHeaders/README.md b/samples/server/petstore/springboot-implicitHeaders/README.md new file mode 100644 index 00000000000..a2e8a9f7b84 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/README.md @@ -0,0 +1,18 @@ +# Swagger generated server + +Spring Boot Server + + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. +This is an example of building a swagger-enabled server in Java using the SpringBoot framework. + +The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox) + +Start your server as an simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/ + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml new file mode 100644 index 00000000000..d777f7d31f1 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + io.swagger + swagger-spring + jar + swagger-spring + 1.0.0 + + 1.7 + ${java.version} + ${java.version} + 2.5.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + + + joda-time + joda-time + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java new file mode 100644 index 00000000000..0c3d276d2d4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java @@ -0,0 +1,20 @@ +package io.swagger; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + + +public class RFC3339DateFormat extends ISO8601DateFormat { + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java new file mode 100644 index 00000000000..c06fbae3c7a --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java @@ -0,0 +1,36 @@ +package io.swagger; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@EnableSwagger2 +@ComponentScan(basePackages = "io.swagger") +public class Swagger2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(Swagger2SpringBoot.class).run(args); + } + + class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java new file mode 100644 index 00000000000..7fa61c50d24 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + + +public class ApiException extends Exception{ + private int code; + public ApiException (int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java new file mode 100644 index 00000000000..f0f62dc7206 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java @@ -0,0 +1,27 @@ +package io.swagger.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + + +public class ApiOriginFilter implements javax.servlet.Filter { + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java new file mode 100644 index 00000000000..f03840f8e06 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import javax.xml.bind.annotation.XmlTransient; + + +@javax.xml.bind.annotation.XmlRootElement +public class ApiResponseMessage { + public static final int ERROR = 1; + public static final int WARNING = 2; + public static final int INFO = 3; + public static final int OK = 4; + public static final int TOO_BUSY = 5; + + int code; + String type; + String message; + + public ApiResponseMessage(){} + + public ApiResponseMessage(int code, String message){ + this.code = code; + switch(code){ + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + @XmlTransient + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java new file mode 100644 index 00000000000..99a374eb894 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -0,0 +1,67 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "fake", description = "the fake API") +public interface FakeApi { + + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/fake", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body); + + + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @Authorization(value = "http_basic_test") + }, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/fake", + produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, + consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, + method = RequestMethod.POST) + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + + + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"),@ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + }) + @RequestMapping(value = "/fake", + produces = { "*/*" }, + consumes = { "*/*" }, + method = RequestMethod.GET) + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java new file mode 100644 index 00000000000..01d1f359a60 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java @@ -0,0 +1,62 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class FakeApiController implements FakeApi { + + + + public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, + @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, + @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, + @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, + @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, + @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, + @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, + @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, + @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java new file mode 100644 index 00000000000..295109d7fc4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + + +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..1ca26cba6a9 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -0,0 +1,166 @@ +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "pet", description = "the pet API") +public interface PetApi { + + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "test", value = "Test header", required=true, dataType = "String", paramType = "header"),@ApiImplicitParam(name = "range", value = "range header", dataType = "Integer", paramType = "header") + }) + @RequestMapping(value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" }, + method = RequestMethod.POST) + ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); + + + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId); + + + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/findByStatus", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); + + + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/findByTags", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); + + + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @Authorization(value = "api_key") + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId); + + + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" }, + method = RequestMethod.PUT) + ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); + + + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + consumes = { "application/x-www-form-urlencoded" }, + method = RequestMethod.POST) + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + + + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}/uploadImage", + produces = { "application/json" }, + consumes = { "multipart/form-data" }, + method = RequestMethod.POST) + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java new file mode 100644 index 00000000000..b7c01ba2f07 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java @@ -0,0 +1,72 @@ +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class PetApiController implements PetApi { + + + + public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, + @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, + @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..b63234b59a4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -0,0 +1,76 @@ +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "store", description = "the store API") +public interface StoreApi { + + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order/{orderId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + + + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/inventory", + produces = { "application/json" }, + method = RequestMethod.GET) + ResponseEntity> getInventory(); + + + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order/{orderId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + + + @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java new file mode 100644 index 00000000000..97a1b7e5129 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java @@ -0,0 +1,47 @@ +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class StoreApiController implements StoreApi { + + + + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity> getInventory() { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..d30ad1a33be --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -0,0 +1,123 @@ +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "user", description = "the user API") +public interface UserApi { + + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body); + + + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/createWithArray", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); + + + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/createWithList", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); + + + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username); + + + @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username); + + + @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/login", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + + + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/logout", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity logoutUser(); + + + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.PUT) + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java new file mode 100644 index 00000000000..c321750e95e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class UserApiController implements UserApi { + + + + public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity logoutUser() { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, + @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java new file mode 100644 index 00000000000..d195523c1d3 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java @@ -0,0 +1,16 @@ +package io.swagger.configuration; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + @RequestMapping(value = "/") + public String index() { + System.out.println("swagger-ui.html"); + return "redirect:swagger-ui.html"; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java new file mode 100644 index 00000000000..5658793e134 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -0,0 +1,40 @@ +package io.swagger.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + + +@Configuration +public class SwaggerDocumentationConfig { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("Swagger Petstore") + .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\") + .license("Apache 2.0") + .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "apiteam@swagger.io")) + .build(); + } + + @Bean + public Docket customImplementation(){ + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("io.swagger.api")) + .build() + .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..81535e041fa --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,110 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesClass + */ + +public class AdditionalPropertiesClass { + @JsonProperty("map_property") + private Map mapProperty = new HashMap(); + + @JsonProperty("map_of_map_property") + private Map> mapOfMapProperty = new HashMap>(); + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @ApiModelProperty(value = "") + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..a218f0b5542 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java @@ -0,0 +1,105 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Animal + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), +}) + +public class Animal { + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..33dc04699af --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,50 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * AnimalFarm + */ + +public class AnimalFarm extends ArrayList { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalFarm {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..3be691e4d95 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayOfArrayOfNumberOnly + */ + +public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") + private List> arrayArrayNumber = new ArrayList>(); + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..12196897345 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayOfNumberOnly + */ + +public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") + private List arrayNumber = new ArrayList(); + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @ApiModelProperty(value = "") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..a26a1600287 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,138 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayTest + */ + +public class ArrayTest { + @JsonProperty("array_of_string") + private List arrayOfString = new ArrayList(); + + @JsonProperty("array_array_of_integer") + private List> arrayArrayOfInteger = new ArrayList>(); + + @JsonProperty("array_array_of_model") + private List> arrayArrayOfModel = new ArrayList>(); + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @ApiModelProperty(value = "") + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..d7ad5642ccf --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java @@ -0,0 +1,189 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Capitalization + */ + +public class Capitalization { + @JsonProperty("smallCamel") + private String smallCamel = null; + + @JsonProperty("CapitalCamel") + private String capitalCamel = null; + + @JsonProperty("small_Snake") + private String smallSnake = null; + + @JsonProperty("Capital_Snake") + private String capitalSnake = null; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints = null; + + @JsonProperty("ATT_NAME") + private String ATT_NAME = null; + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @ApiModelProperty(value = "") + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @ApiModelProperty(value = "") + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @ApiModelProperty(value = "") + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @ApiModelProperty(value = "") + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java new file mode 100644 index 00000000000..747e5dc0c7e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java @@ -0,0 +1,76 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import javax.validation.constraints.*; +/** + * Cat + */ + +public class Cat extends Animal { + @JsonProperty("declawed") + private Boolean declawed = null; + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @ApiModelProperty(value = "") + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..9629da6500e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Category + */ + +public class Category { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..d69acffefa8 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") + +public class ClassModel { + @JsonProperty("_class") + private String propertyClass = null; + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..f9cec5a225e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Client + */ + +public class Client { + @JsonProperty("client") + private String client = null; + + public Client client(String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @ApiModelProperty(value = "") + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..9057e840fc3 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java @@ -0,0 +1,76 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import javax.validation.constraints.*; +/** + * Dog + */ + +public class Dog extends Animal { + @JsonProperty("breed") + private String breed = null; + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..97ab6f6410e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,167 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * EnumArrays + */ + +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String text) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("just_symbol") + private JustSymbolEnum justSymbol = null; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("array_enum") + private List arrayEnum = new ArrayList(); + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @ApiModelProperty(value = "") + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..cdfc0933c3e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java @@ -0,0 +1,41 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..9f2a0275a6a --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java @@ -0,0 +1,240 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.OuterEnum; +import javax.validation.constraints.*; +/** + * EnumTest + */ + +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String text) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string") + private EnumStringEnum enumString = null; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_integer") + private EnumIntegerEnum enumInteger = null; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(String text) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_number") + private EnumNumberEnum enumNumber = null; + + @JsonProperty("outerEnum") + private OuterEnum outerEnum = null; + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..aed8db1ed96 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java @@ -0,0 +1,380 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.UUID; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import javax.validation.constraints.*; +/** + * FormatTest + */ + +public class FormatTest { + @JsonProperty("integer") + private Integer integer = null; + + @JsonProperty("int32") + private Integer int32 = null; + + @JsonProperty("int64") + private Long int64 = null; + + @JsonProperty("number") + private BigDecimal number = null; + + @JsonProperty("float") + private Float _float = null; + + @JsonProperty("double") + private Double _double = null; + + @JsonProperty("string") + private String string = null; + + @JsonProperty("byte") + private byte[] _byte = null; + + @JsonProperty("binary") + private byte[] binary = null; + + @JsonProperty("date") + private LocalDate date = null; + + @JsonProperty("dateTime") + private DateTime dateTime = null; + + @JsonProperty("uuid") + private UUID uuid = null; + + @JsonProperty("password") + private String password = null; + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @ApiModelProperty(value = "") + @Min(10) + @Max(100) + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @ApiModelProperty(value = "") + @Min(20) + @Max(200) + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @ApiModelProperty(value = "") + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @ApiModelProperty(value = "") + @DecimalMin("54.3") + @DecimalMax("987.6") + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @ApiModelProperty(value = "") + @DecimalMin("67.8") + @DecimalMax("123.4") + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @ApiModelProperty(value = "") + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(value = "") + public DateTime getDateTime() { + return dateTime; + } + + public void setDateTime(DateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..a26492e4912 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * HasOnlyReadOnly + */ + +public class HasOnlyReadOnly { + @JsonProperty("bar") + private String bar = null; + + @JsonProperty("foo") + private String foo = null; + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..9a0566a8dd1 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java @@ -0,0 +1,142 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +/** + * MapTest + */ + +public class MapTest { + @JsonProperty("map_map_of_string") + private Map> mapMapOfString = new HashMap>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String text) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("map_of_enum_string") + private Map mapOfEnumString = new HashMap(); + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..2cb9928d5fe --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,131 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.joda.time.DateTime; +import javax.validation.constraints.*; +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ + +public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") + private UUID uuid = null; + + @JsonProperty("dateTime") + private DateTime dateTime = null; + + @JsonProperty("map") + private Map map = new HashMap(); + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(value = "") + public DateTime getDateTime() { + return dateTime; + } + + public void setDateTime(DateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @ApiModelProperty(value = "") + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..4d47f6c03c9 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model name starting with number + */ +@ApiModel(description = "Model for testing model name starting with number") + +public class Model200Response { + @JsonProperty("name") + private Integer name = null; + + @JsonProperty("class") + private String propertyClass = null; + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @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) && + Objects.equals(this.propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..36da9b20d9d --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,120 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * ModelApiResponse + */ + +public class ModelApiResponse { + @JsonProperty("code") + private Integer code = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("message") + private String message = null; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(value = "") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..7ffc24a0144 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing reserved words + */ +@ApiModel(description = "Model for testing reserved words") + +public class ModelReturn { + @JsonProperty("return") + private Integer _return = null; + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @ApiModelProperty(value = "") + 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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..953199166ff --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java @@ -0,0 +1,145 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model name same as property name + */ +@ApiModel(description = "Model for testing model name same as property name") + +public class Name { + @JsonProperty("name") + private Integer name = null; + + @JsonProperty("snake_case") + private Integer snakeCase = null; + + @JsonProperty("property") + private String property = null; + + @JsonProperty("123Number") + private Integer _123Number = null; + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @ApiModelProperty(readOnly = true, value = "") + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @ApiModelProperty(value = "") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + /** + * Get _123Number + * @return _123Number + **/ + @ApiModelProperty(readOnly = true, value = "") + public Integer get123Number() { + return _123Number; + } + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @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) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @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(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..e6dbf3139e2 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import javax.validation.constraints.*; +/** + * NumberOnly + */ + +public class NumberOnly { + @JsonProperty("JustNumber") + private BigDecimal justNumber = null; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..41dec079587 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java @@ -0,0 +1,224 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.joda.time.DateTime; +import javax.validation.constraints.*; +/** + * Order + */ + +public class Order { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("petId") + private Long petId = null; + + @JsonProperty("quantity") + private Integer quantity = null; + + @JsonProperty("shipDate") + private DateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @ApiModelProperty(value = "") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @ApiModelProperty(value = "") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(DateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @ApiModelProperty(value = "") + public DateTime getShipDate() { + return shipDate; + } + + public void setShipDate(DateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @ApiModelProperty(value = "") + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..5f0075e4457 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,41 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..9adc708de71 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java @@ -0,0 +1,239 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * Pet + */ + +public class Pet { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("category") + private Category category = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("photoUrls") + private List photoUrls = new ArrayList(); + + @JsonProperty("tags") + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @ApiModelProperty(value = "") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..47700659fd2 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * ReadOnlyFirst + */ + +public class ReadOnlyFirst { + @JsonProperty("bar") + private String bar = null; + + @JsonProperty("baz") + private String baz = null; + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @ApiModelProperty(value = "") + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..880d70599b0 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * SpecialModelName + */ + +public class SpecialModelName { + @JsonProperty("$special[property.name]") + private Long specialPropertyName = null; + + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + @ApiModelProperty(value = "") + 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/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..298085317a4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Tag + */ + +public class Tag { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java new file mode 100644 index 00000000000..8e40f7e0594 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java @@ -0,0 +1,235 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * User + */ + +public class User { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("username") + private String username = null; + + @JsonProperty("firstName") + private String firstName = null; + + @JsonProperty("lastName") + private String lastName = null; + + @JsonProperty("email") + private String email = null; + + @JsonProperty("password") + private String password = null; + + @JsonProperty("phone") + private String phone = null; + + @JsonProperty("userStatus") + private Integer userStatus = null; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @ApiModelProperty(value = "") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @ApiModelProperty(value = "") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @ApiModelProperty(value = "") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @ApiModelProperty(value = "") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties new file mode 100644 index 00000000000..a2ef8627027 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties @@ -0,0 +1,5 @@ +springfox.documentation.swagger.v2.path=/api-docs +server.contextPath=/v2 +server.port=8080 +spring.jackson.date-format=io.swagger.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false \ No newline at end of file From 913d05c17c04362f62145997e85aa26118ab3576 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 7 Mar 2017 15:32:41 +0800 Subject: [PATCH 079/132] [Python][Flask] Fix inconsistency between model name and file name (#4958) * fix inconsistence between model name and file name in python flask * add object as primitype type in python flask --- .../languages/FlaskConnexionCodegen.java | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index e99a6b29e38..61a624648ba 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -50,6 +50,7 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf languageSpecificPrimitives.add("datetime"); languageSpecificPrimitives.add("date"); languageSpecificPrimitives.add("file"); + languageSpecificPrimitives.add("object"); typeMapping.clear(); typeMapping.put("integer", "int"); @@ -413,33 +414,9 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf @Override public String toModelFilename(String name) { - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - // remove dollar sign - name = name.replaceAll("$", ""); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - LOGGER.warn(name + " (reserved word) cannot be used as model filename. Renamed to " + underscore(dropDots("model_" + name))); - name = "model_" + name; // e.g. return => ModelReturn (after camelize) - } - - // model name starts with number - if (name.matches("^\\d.*")) { - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + underscore("model_" + name)); - name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; - } - // underscore the model file name // PhoneNumber => phone_number - return underscore(dropDots(name)); + return underscore(dropDots(toModelName(name))); } @Override From 0f88e4a721e641a373752be6b3855c71d5bcf140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Tue, 7 Mar 2017 10:26:57 +0100 Subject: [PATCH 080/132] fix (partially) #4898 for MSF4J. (#4917) --- .../src/main/resources/MSF4J/formParams.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache index 249266065db..0a8a7225031 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache @@ -1,3 +1,3 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} - @FormDataParam("{{paramName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{paramName}}") FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} + @FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, + @FormDataParam("{{baseName}}") FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} From 404a9999a7cccbd565ed9173da19986ce5258db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Tue, 7 Mar 2017 10:28:08 +0100 Subject: [PATCH 081/132] Fix (partially) #4898 for swift3 (#4916) * fix (partially) #4898 for swift3. * Update petstore samples for swift3 (after fix for #4898) --- .../src/main/resources/swift3/api.mustache | 2 +- .../Classes/Swaggers/APIs/PetAPI.swift | 38 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 26 ++++++------- .../Classes/Swaggers/APIs/UserAPI.swift | 8 ++-- .../Classes/Swaggers/APIs/PetAPI.swift | 38 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 24 ++++++------ .../Classes/Swaggers/APIs/UserAPI.swift | 8 ++-- .../Classes/Swaggers/APIs/PetAPI.swift | 38 +++++++++---------- .../Classes/Swaggers/APIs/StoreAPI.swift | 22 +++++------ .../Classes/Swaggers/APIs/UserAPI.swift | 4 +- 10 files changed, 104 insertions(+), 104 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swift3/api.mustache b/modules/swagger-codegen/src/main/resources/swift3/api.mustache index 81756029952..89768cd5832 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/api.mustache @@ -105,7 +105,7 @@ open class {{classname}}: APIBase { */ open class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{path}}"{{#pathParams}} - path = path.replacingOccurrences(of: "{{=<% %>=}}{<%paramName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} + path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} let URLString = {{projectName}}API.basePath + path {{#bodyParam}} let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() as? [String:AnyObject] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 6c9db5c937c..852c37fae46 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -134,14 +134,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 7, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 4 }, "tags" : [ { "name" : "aeiou", - "id" : 6 + "id" : 5 } ], "status" : "available" } ]}] @@ -157,14 +157,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 7, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 4 }, "tags" : [ { "name" : "aeiou", - "id" : 6 + "id" : 5 } ], "status" : "available" } ]}] @@ -221,14 +221,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 2, + "id" : 3, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 6 + "id" : 9 } ], "status" : "available" } ]}] @@ -244,14 +244,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 2, + "id" : 3, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 6 + "id" : 9 } ], "status" : "available" } ]}] @@ -308,14 +308,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 0, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 8 } ], "status" : "available" }}] @@ -331,14 +331,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 0, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 8 } ], "status" : "available" }}] @@ -471,7 +471,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 4, + "code" : 9, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index b879d5066d6..f68aa46de59 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -66,7 +66,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 7 + "key" : 5 }}] - returns: RequestBuilder<[String:Int32]> @@ -109,9 +109,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 1, - "quantity" : 7, - "id" : 5, + "petId" : 8, + "quantity" : 9, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -124,9 +124,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 1, - "quantity" : 7, - "id" : 5, + "petId" : 8, + "quantity" : 9, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -175,9 +175,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 3, - "quantity" : 1, - "id" : 9, + "petId" : 6, + "quantity" : 6, + "id" : 7, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -190,9 +190,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 3, - "quantity" : 1, - "id" : 9, + "petId" : 6, + "quantity" : 6, + "id" : 7, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 8ed4814cad9..772baa19fe0 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -181,9 +181,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 0, + "userStatus" : 8, "phone" : "aeiou", - "id" : 7, + "id" : 6, "email" : "aeiou", "username" : "aeiou" }}] @@ -200,9 +200,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 0, + "userStatus" : 8, "phone" : "aeiou", - "id" : 7, + "id" : 6, "email" : "aeiou", "username" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 4368f4954f1..b35c0c7b476 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -187,14 +187,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 1, + "id" : 5, "category" : { "name" : "aeiou", - "id" : 0 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 2 + "id" : 4 } ], "status" : "available" } ]}] @@ -210,14 +210,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 1, + "id" : 5, "category" : { "name" : "aeiou", - "id" : 0 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 2 + "id" : 4 } ], "status" : "available" } ]}] @@ -291,14 +291,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 9 + "id" : 3 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 8 } ], "status" : "available" } ]}] @@ -314,14 +314,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 9 + "id" : 3 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 8 } ], "status" : "available" } ]}] @@ -395,14 +395,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 8, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 8 }, "tags" : [ { "name" : "aeiou", - "id" : 4 + "id" : 7 } ], "status" : "available" }}] @@ -418,14 +418,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 8, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 5 + "id" : 8 }, "tags" : [ { "name" : "aeiou", - "id" : 4 + "id" : 7 } ], "status" : "available" }}] @@ -613,7 +613,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 0, + "code" : 7, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index ee9734a9d68..ca6f1f49df9 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -160,9 +160,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 2, - "quantity" : 9, - "id" : 4, + "petId" : 6, + "quantity" : 5, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -175,9 +175,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 2, - "quantity" : 9, - "id" : 4, + "petId" : 6, + "quantity" : 5, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -243,9 +243,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 8, - "quantity" : 2, - "id" : 0, + "petId" : 9, + "quantity" : 9, + "id" : 3, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -258,9 +258,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 8, - "quantity" : 2, - "id" : 0, + "petId" : 9, + "quantity" : 9, + "id" : 3, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 4a230289485..d28bec41e38 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -267,9 +267,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 9, + "userStatus" : 5, "phone" : "aeiou", - "id" : 9, + "id" : 0, "email" : "aeiou", "username" : "aeiou" }}] @@ -286,9 +286,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 9, + "userStatus" : 5, "phone" : "aeiou", - "id" : 9, + "id" : 0, "email" : "aeiou", "username" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 540fe41b57c..84a61915862 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -193,14 +193,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 2, + "id" : 6, "category" : { "name" : "aeiou", - "id" : 2 + "id" : 6 }, "tags" : [ { "name" : "aeiou", - "id" : 0 + "id" : 1 } ], "status" : "available" } ]}] @@ -216,14 +216,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 2, + "id" : 6, "category" : { "name" : "aeiou", - "id" : 2 + "id" : 6 }, "tags" : [ { "name" : "aeiou", - "id" : 0 + "id" : 1 } ], "status" : "available" } ]}] @@ -299,14 +299,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 0 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 2 } ], "status" : "available" } ]}] @@ -322,14 +322,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 4, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 0 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 3 + "id" : 2 } ], "status" : "available" } ]}] @@ -405,14 +405,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 1, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 1 + "id" : 7 }, "tags" : [ { "name" : "aeiou", - "id" : 2 + "id" : 7 } ], "status" : "available" }}] @@ -428,14 +428,14 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 1, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 1 + "id" : 7 }, "tags" : [ { "name" : "aeiou", - "id" : 2 + "id" : 7 } ], "status" : "available" }}] @@ -629,7 +629,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 1, + "code" : 9, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 6414443125d..c21a0be53d5 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -104,7 +104,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 7 + "key" : 9 }}] - returns: RequestBuilder<[String:Int32]> @@ -166,9 +166,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 6, + "petId" : 0, "quantity" : 0, - "id" : 5, + "id" : 2, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -181,9 +181,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 6, + "petId" : 0, "quantity" : 0, - "id" : 5, + "id" : 2, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -251,9 +251,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 3, - "quantity" : 8, - "id" : 8, + "petId" : 4, + "quantity" : 3, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" @@ -266,9 +266,9 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 3, - "quantity" : 8, - "id" : 8, + "petId" : 4, + "quantity" : 3, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 9a5081f2f51..bd784dcce0d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -279,7 +279,7 @@ open class UserAPI: APIBase { "password" : "aeiou", "userStatus" : 2, "phone" : "aeiou", - "id" : 4, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] @@ -298,7 +298,7 @@ open class UserAPI: APIBase { "password" : "aeiou", "userStatus" : 2, "phone" : "aeiou", - "id" : 4, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] From 290cb7c3311d85bfdb0c0d977b391874bebe1983 Mon Sep 17 00:00:00 2001 From: stevecookform3 Date: Tue, 7 Mar 2017 14:23:55 +0000 Subject: [PATCH 082/132] fix path/query parameters (#4959) From f236b088771058b2196ee71e370c062392964d91 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 7 Mar 2017 23:23:38 +0800 Subject: [PATCH 083/132] minor formatting fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51e65473e75..7aad69a2981 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ cd /vagrant - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) -======= + ##### Swagger Generator Docker Image From 6383872b5f47ce28709e4104a0e0ff1856d07af8 Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:25:21 +0100 Subject: [PATCH 084/132] update beanvalidation templates and sample for jersey2 #4719 (#4735) --- .../resources/Java/beanValidation.mustache | 51 +------------------ .../Java/beanValidationCore.mustache | 20 ++++++++ .../Java/beanValidationQueryParams.mustache | 2 +- .../client/petstore/java/jersey2/git_push.sh | 6 +-- 4 files changed, 25 insertions(+), 54 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache index cca08f4b2c4..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}}/* @Min({{minimum}}) */{{/minimum}}{{#maximum}}/* @Max({{maximum}}) */{{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/git_push.sh b/samples/client/petstore/java/jersey2/git_push.sh index ed374619b13..6ca091b49d9 100644 --- a/samples/client/petstore/java/jersey2/git_push.sh +++ b/samples/client/petstore/java/jersey2/git_push.sh @@ -8,17 +8,17 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" + git_user_id="" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" + 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" + release_note="" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi From c4475861b04174245b3611f5751bf1fe48a3c6cd Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:26:06 +0100 Subject: [PATCH 085/132] update beanvalidation templates #4719 (#4734) --- .../resteasy/beanValidation.mustache | 51 +------------------ .../resteasy/beanValidationCore.mustache | 20 ++++++++ .../beanValidationPathParams.mustache | 2 +- .../beanValidationQueryParams.mustache | 2 +- 4 files changed, 23 insertions(+), 52 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file From 1e8312782b3c9cce3e4bf5e4704526dfe950d9a2 Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:26:30 +0100 Subject: [PATCH 086/132] [Jaxrs-spec] Merge beanValidation/beanValidationParams.mustache (#4731) * update beanvalidation templates #4719 * update jaxrs-sample #4719 --- .../JavaJaxRS/spec/beanValidation.mustache | 51 +------------------ .../spec/beanValidationCore.mustache | 20 ++++++++ .../spec/beanValidationPathParams.mustache | 2 +- .../spec/beanValidationQueryParams.mustache | 2 +- .../src/gen/java/io/swagger/api/FakeApi.java | 4 +- .../model/AdditionalPropertiesClass.java | 4 +- .../src/gen/java/io/swagger/model/Animal.java | 4 +- .../gen/java/io/swagger/model/AnimalFarm.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../io/swagger/model/ArrayOfNumberOnly.java | 4 +- .../gen/java/io/swagger/model/ArrayTest.java | 4 +- .../java/io/swagger/model/Capitalization.java | 4 +- .../src/gen/java/io/swagger/model/Cat.java | 4 +- .../gen/java/io/swagger/model/Category.java | 4 +- .../gen/java/io/swagger/model/ClassModel.java | 4 +- .../src/gen/java/io/swagger/model/Client.java | 4 +- .../src/gen/java/io/swagger/model/Dog.java | 4 +- .../gen/java/io/swagger/model/EnumArrays.java | 4 +- .../gen/java/io/swagger/model/EnumTest.java | 4 +- .../gen/java/io/swagger/model/FormatTest.java | 30 ++++------- .../io/swagger/model/HasOnlyReadOnly.java | 4 +- .../gen/java/io/swagger/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../io/swagger/model/Model200Response.java | 4 +- .../io/swagger/model/ModelApiResponse.java | 4 +- .../java/io/swagger/model/ModelReturn.java | 4 +- .../src/gen/java/io/swagger/model/Name.java | 4 +- .../gen/java/io/swagger/model/NumberOnly.java | 4 +- .../src/gen/java/io/swagger/model/Order.java | 4 +- .../src/gen/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/model/ReadOnlyFirst.java | 4 +- .../io/swagger/model/SpecialModelName.java | 4 +- .../src/gen/java/io/swagger/model/Tag.java | 4 +- .../src/gen/java/io/swagger/model/User.java | 4 +- .../server/petstore/jaxrs-spec/swagger.json | 10 ++-- 35 files changed, 95 insertions(+), 136 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java index a0553e646ed..f8581b82c1b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -42,7 +42,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = void.class), @ApiResponse(code = 404, message = "User not found", response = void.class) }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "_double") Double _double,@FormParam(value = "patternWithoutDelimiter") String patternWithoutDelimiter,@FormParam(value = "_byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "_float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") javax.xml.datatype.XMLGregorianCalendar dateTime,@FormParam(value = "password") String password,@FormParam(value = "paramCallback") String paramCallback) { return Response.ok().entity("magic!").build(); } @@ -54,7 +54,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = void.class), @ApiResponse(code = 404, message = "Not found", response = void.class) }) - public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) { + public Response testEnumParameters(@FormParam(value = "enumFormStringArray") List enumFormStringArray,@FormParam(value = "enumFormString") String enumFormString,@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enumQueryDouble") Double enumQueryDouble) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 083c8f8367e..e30da46f35a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class AdditionalPropertiesClass { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -81,7 +81,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java index 8650d14e8bc..64d5951369d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -81,7 +81,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java index 200775f0167..b7fe2f4cc88 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -15,7 +15,7 @@ public class AnimalFarm extends ArrayList { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -44,7 +44,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 0bd229b83e9..eca82ce2346 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -32,7 +32,7 @@ public class ArrayOfArrayOfNumberOnly { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -62,7 +62,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 1efb2d90df2..0781aaa524f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -32,7 +32,7 @@ public class ArrayOfNumberOnly { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -62,7 +62,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java index b49ad740fc5..ec005634cc3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -66,7 +66,7 @@ public class ArrayTest { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -100,7 +100,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java index a500fed35d7..1259f458e33 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java @@ -115,7 +115,7 @@ public class Capitalization { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -155,7 +155,7 @@ public class Capitalization { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index 369e4e84ed4..45f8e305503 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -30,7 +30,7 @@ public class Cat extends Animal { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java index a3a2cc5be04..08ce4b59b3a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java @@ -46,7 +46,7 @@ public class Category { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java index f2396de59f5..b185dec45cb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -63,7 +63,7 @@ public class ClassModel { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java index 49c7ed5e3a5..7680ebe1b58 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -29,7 +29,7 @@ public class Client { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -59,7 +59,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java index aa9e82bcf5f..e48f4c000ef 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -30,7 +30,7 @@ public class Dog extends Animal { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index cf28b24b49c..7aca1496efe 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -110,7 +110,7 @@ public enum ArrayEnumEnum { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -142,7 +142,7 @@ public enum ArrayEnumEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index a6acba24418..bb602ad3b73 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -174,7 +174,7 @@ public enum EnumNumberEnum { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public enum EnumNumberEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index e76e3b60134..1afafe4bf20 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -37,9 +37,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } public void setInteger(Integer integer) { @@ -57,9 +55,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } public void setInt32(Integer int32) { @@ -94,9 +90,7 @@ public class FormatTest { @ApiModelProperty(example = "null", required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } public void setNumber(BigDecimal number) { @@ -114,9 +108,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } public void setFloat(Float _float) { @@ -134,9 +126,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } public void setDouble(Double _double) { @@ -152,8 +142,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } public void setString(String string) { @@ -252,8 +241,7 @@ public class FormatTest { @ApiModelProperty(example = "null", required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } public void setPassword(String password) { @@ -262,7 +250,7 @@ public class FormatTest { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -316,7 +304,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 8d8ceadc630..f0bb80cdeb8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -46,7 +46,7 @@ public class HasOnlyReadOnly { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 2f476ef0b11..39e105546fe 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -80,7 +80,7 @@ public enum InnerEnum { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -112,7 +112,7 @@ public enum InnerEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 713aa31a066..6c4654ce3a5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,7 +68,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -102,7 +102,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java index 95705f23a52..2278ea9212d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -50,7 +50,7 @@ public class Model200Response { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -82,7 +82,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java index df776f7a4fe..9e570802581 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -63,7 +63,7 @@ public class ModelApiResponse { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -97,7 +97,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java index e0e35d3eec6..9c348ada11a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -33,7 +33,7 @@ public class ModelReturn { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -63,7 +63,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java index 01448e9d94b..dbf1620a75a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -85,7 +85,7 @@ public class Name { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -121,7 +121,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java index aa5f557859a..cfd26e8bbc1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -30,7 +30,7 @@ public class NumberOnly { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -60,7 +60,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index 0bff53a3e85..c9af9b68a99 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -146,7 +146,7 @@ public enum StatusEnum { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -186,7 +186,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index bd6671115ca..dafcad72d14 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -152,7 +152,7 @@ public enum StatusEnum { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -192,7 +192,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java index a38b33097f8..cfdba394a3e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -46,7 +46,7 @@ public class ReadOnlyFirst { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java index ec901836d3d..9b80b631cc7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -29,7 +29,7 @@ public class SpecialModelName { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -59,7 +59,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java index a007d782c1c..1debd2a7ecb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java @@ -46,7 +46,7 @@ public class Tag { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -78,7 +78,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java index 385cad6d8e8..4b2896fa862 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java @@ -149,7 +149,7 @@ public class User { @Override - public boolean equals(java.lang.Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -193,7 +193,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) { + private String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 410db7bf5d7..72b46bb8936 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -760,15 +760,15 @@ "description" : "None", "required" : true, "type" : "number", - "maximum" : 543.2, - "minimum" : 32.1 + "maximum" : 543.200000000000045474735088646411895751953125, + "minimum" : 32.10000000000000142108547152020037174224853515625 }, { "name" : "float", "in" : "formData", "description" : "None", "required" : false, "type" : "number", - "maximum" : 987.6, + "maximum" : 987.6000000000000227373675443232059478759765625, "format" : "float" }, { "name" : "double", @@ -776,8 +776,8 @@ "description" : "None", "required" : true, "type" : "number", - "maximum" : 123.4, - "minimum" : 67.8, + "maximum" : 123.400000000000005684341886080801486968994140625, + "minimum" : 67.7999999999999971578290569595992565155029296875, "format" : "double" }, { "name" : "string", From 6a7340378ac89ecc48cea2cb605f8afff1ac5bfa Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:34:40 +0100 Subject: [PATCH 087/132] update beanvalidation templates + samples #4719 (#4733) --- .../JavaJaxRS/cxf/beanValidation.mustache | 51 +------------------ .../JavaJaxRS/cxf/beanValidationCore.mustache | 20 ++++++++ .../cxf/beanValidationPathParams.mustache | 1 + .../cxf/beanValidationQueryParams.mustache | 2 +- .../JavaJaxRS/cxf/pathParams.mustache | 2 +- .../src/gen/java/io/swagger/api/StoreApi.java | 2 +- .../gen/java/io/swagger/model/FormatTest.java | 26 +++------- 7 files changed, 32 insertions(+), 72 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache new file mode 100644 index 00000000000..051bd53c0a5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache index ba153467a65..9e8455d5ac7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 4a3ffd1020b..82f00f1b28c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -37,7 +37,7 @@ public interface StoreApi { @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) - public Order getOrderById(@PathParam("orderId") Long orderId); + public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); @POST @Path("/store/order") diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index 01bfba5b814..1b8717f6ebc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -49,9 +49,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -70,9 +68,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -109,9 +105,7 @@ public class FormatTest { * @return number **/ @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -130,9 +124,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -151,9 +143,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -170,8 +160,7 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -276,8 +265,7 @@ public class FormatTest { * @return password **/ @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } From 2f43f98cfa9a983cabd8b0a75179057e7d3828c7 Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:35:06 +0100 Subject: [PATCH 088/132] update beanvalidation templates and samples jersey2 #4719 (#4732) --- .../JavaJaxRS/beanValidation.mustache | 51 +------------------ .../JavaJaxRS/beanValidationCore.mustache | 20 ++++++++ .../beanValidationPathParams.mustache | 2 +- .../beanValidationQueryParams.mustache | 2 +- .../gen/java/io/swagger/model/FormatTest.java | 26 +++------- 5 files changed, 30 insertions(+), 71 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index eaba5daefe7..bdd53cb3e5d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -80,9 +80,7 @@ public class FormatTest { **/ @JsonProperty("integer") @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -103,9 +101,7 @@ public class FormatTest { **/ @JsonProperty("int32") @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -146,9 +142,7 @@ public class FormatTest { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -169,9 +163,7 @@ public class FormatTest { **/ @JsonProperty("float") @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -192,9 +184,7 @@ public class FormatTest { **/ @JsonProperty("double") @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -213,8 +203,7 @@ public class FormatTest { **/ @JsonProperty("string") @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -331,8 +320,7 @@ public class FormatTest { @JsonProperty("password") @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } From 871b3ceef7d9e2afbfff50e76aa4c097224bb742 Mon Sep 17 00:00:00 2001 From: jfiala Date: Tue, 7 Mar 2017 16:35:21 +0100 Subject: [PATCH 089/132] update templates and samples for spring-boot #4719 (#4736) --- .../JavaSpring/beanValidation.mustache | 51 +------------------ .../JavaSpring/beanValidationCore.mustache | 20 ++++++++ .../beanValidationPathParams.mustache | 2 +- .../beanValidationQueryParams.mustache | 2 +- .../java/io/swagger/model/FormatTest.java | 26 +++------- 5 files changed, 30 insertions(+), 71 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java index aed8db1ed96..ad8680a3beb 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } From 3e3d3600275d9eb52c26a7bd337493eb42deb0da Mon Sep 17 00:00:00 2001 From: Kyle Maxwell Date: Tue, 7 Mar 2017 22:03:45 -0600 Subject: [PATCH 090/132] Add proxy support to fix #4639 (#4946) * Add proxy support to fix #4639 * Update sample app for testing * Fix indentation and remove leftover code * Update sample for new rest template --- .../resources/python/configuration.mustache | 3 ++ .../src/main/resources/python/rest.mustache | 31 ++++++++++++++----- .../python/petstore_api/configuration.py | 3 ++ .../python/petstore_api/rest.py | 25 ++++++++++++++- .../python/petstore_api/configuration.py | 3 ++ .../petstore/python/petstore_api/rest.py | 31 ++++++++++++++----- 6 files changed, 79 insertions(+), 17 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 5ddc4ab7bca..b3961009f16 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -80,6 +80,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 910d3001edf..6c2c21d3055 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -76,15 +76,30 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + # https pool manager - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=cert_file, - key_file=key_file - ) + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): diff --git a/samples/client/petstore-security-test/python/petstore_api/configuration.py b/samples/client/petstore-security-test/python/petstore_api/configuration.py index 55b00220da5..99212e2f180 100644 --- a/samples/client/petstore-security-test/python/petstore_api/configuration.py +++ b/samples/client/petstore-security-test/python/petstore_api/configuration.py @@ -89,6 +89,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/samples/client/petstore-security-test/python/petstore_api/rest.py b/samples/client/petstore-security-test/python/petstore_api/rest.py index 2c54f4ceae8..513bbb5aac7 100644 --- a/samples/client/petstore-security-test/python/petstore_api/rest.py +++ b/samples/client/petstore-security-test/python/petstore_api/rest.py @@ -85,10 +85,33 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + + # https pool manager + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + # https pool manager self.pool_manager = urllib3.PoolManager( num_pools=pools_size, - maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=cert_file, diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index e6763164fa2..d736f570be5 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -89,6 +89,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 5fda97044b3..3ed3cf31849 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -85,15 +85,30 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + # https pool manager - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=cert_file, - key_file=key_file - ) + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): From 5935e2e6d9de1d2c4ead65cd62ad99c633a68fef Mon Sep 17 00:00:00 2001 From: delenius Date: Tue, 7 Mar 2017 23:26:46 -0800 Subject: [PATCH 091/132] Add support for saving/returning cookies (#4192) This adds a `saveCookies` boolean flag to ApiClient. If set to true, the client will save and return cookies to the server. This is useful for supporting @SessionScoped beans in Java servers. Works both in Node.js desktop apps, and in the browser. --- .../resources/Javascript/ApiClient.mustache | 32 ++++++++++++++ .../javascript-promise/src/ApiClient.js | 44 ++++++++++++++++--- .../petstore/javascript/src/ApiClient.js | 29 ++++++++++++ 3 files changed, 99 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index ffe6c32dc8f..e5af8ff80a5 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -75,6 +75,22 @@ * @default true */ this.cache = true; + +{{#emitJSDoc}} /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ +{{/emitJSDoc}} this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; {{#emitJSDoc}} /** @@ -405,6 +421,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + {{#usePromises}} return new Promise(function(resolve, reject) { request.end(function(error, response) { if (error) { @@ -412,6 +438,9 @@ } else { try { var data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } resolve({data, response}); } catch (err) { reject(err); @@ -425,6 +454,9 @@ if (!error) { try { data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } } catch (err) { error = err; } diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 6a64ce46bc7..4b3872b980e 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -14,18 +14,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.ApiClient = factory(root.superagent); + root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; /** @@ -78,6 +78,22 @@ * @default true */ this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; /** @@ -377,7 +393,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { @@ -399,6 +415,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + return new Promise(function(resolve, reject) { request.end(function(error, response) { if (error) { @@ -406,6 +432,9 @@ } else { try { var data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } resolve({data, response}); } catch (err) { reject(err); @@ -431,9 +460,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index c3be4990de9..017b50b1335 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -78,6 +78,22 @@ * @default true */ this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; /** @@ -408,6 +424,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + request.end(function(error, response) { if (callback) { @@ -415,6 +441,9 @@ if (!error) { try { data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } } catch (err) { error = err; } From 5dbcf6e8e4168fc54b1c799a302a976aa864a88f Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 8 Mar 2017 16:57:29 +0800 Subject: [PATCH 092/132] [JavaScript] fix issues with boolean CLI options (#4974) * remove commented code * fix issue with boolean clioption in js codegen --- .../ignore/CodegenIgnoreProcessor.java | 2 +- .../languages/JavascriptClientCodegen.java | 37 ++----------------- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java index 2852c6eed96..0de8d29862f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java @@ -45,7 +45,7 @@ public class CodegenIgnoreProcessor { if (directory.exists() && directory.isDirectory()) { loadFromFile(targetIgnoreFile); } else { - LOGGER.warn("Directory does not exist, or is inaccessible. No file will be evaluated."); + LOGGER.warn("Output directory does not exist, or is inaccessible. No file (.swager-codegen-ignore) will be evaluated."); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index dd211512906..04f557cef83 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -202,7 +202,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo Boolean.valueOf(additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP).toString())); } - if (additionalProperties.containsKey(PROJECT_NAME)) { setProjectName(((String) additionalProperties.get(PROJECT_NAME))); } @@ -228,19 +227,19 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } if (additionalProperties.containsKey(USE_PROMISES)) { - setUsePromises(Boolean.parseBoolean((String)additionalProperties.get(USE_PROMISES))); + setUsePromises(convertPropertyToBooleanAndWriteBack(USE_PROMISES)); } if (additionalProperties.containsKey(USE_INHERITANCE)) { - setUseInheritance(Boolean.parseBoolean((String)additionalProperties.get(USE_INHERITANCE))); + setUseInheritance(convertPropertyToBooleanAndWriteBack(USE_INHERITANCE)); } else { supportsInheritance = true; supportsMixins = true; } if (additionalProperties.containsKey(EMIT_MODEL_METHODS)) { - setEmitModelMethods(Boolean.parseBoolean((String)additionalProperties.get(EMIT_MODEL_METHODS))); + setEmitModelMethods(convertPropertyToBooleanAndWriteBack(EMIT_MODEL_METHODS)); } if (additionalProperties.containsKey(EMIT_JS_DOC)) { - setEmitJSDoc(Boolean.parseBoolean((String)additionalProperties.get(EMIT_JS_DOC))); + setEmitJSDoc(convertPropertyToBooleanAndWriteBack(EMIT_JS_DOC)); } } @@ -778,12 +777,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo + (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType; } - /* - private String getJSDocTypeWithBraces(CodegenModel cm, CodegenProperty cp) { - return "{" + getJSDocType(cm, cp) + "}"; - } - */ - private String getJSDocType(CodegenModel cm, CodegenProperty cp) { if (Boolean.TRUE.equals(cp.isContainer)) { if (cp.containerType.equals("array")) @@ -805,12 +798,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.datatype : cp.baseType); } - /* - private String getJSDocTypeWithBraces(CodegenParameter cp) { - return "{" + getJSDocType(cp) + "}"; - } - */ - private String getJSDocType(CodegenParameter cp) { String dataType = trimBrackets(cp.dataType); if (isModelledType(cp)) @@ -828,13 +815,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.dataType : cp.baseType); } - /* - private String getJSDocTypeWithBraces(CodegenOperation co) { - String jsDocType = getJSDocType(co); - return jsDocType == null ? null : "{" + jsDocType + "}"; - } - */ - private String getJSDocType(CodegenOperation co) { String returnType = trimBrackets(co.returnType); if (returnType != null) { @@ -950,15 +930,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type); } -/* - @Override - public String findCommonPrefixOfVars(List vars) { - String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); - // exclude trailing characters that should be part of a valid variable - // e.g. ["status-on", "status-off"] => "status-" (not "status-o") - return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); - } -*/ private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { // This generator uses inline classes to define enums, which breaks when From 89ad5e59b8d1ed7ec876a13f3db988a813ecff20 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 8 Mar 2017 17:39:22 +0800 Subject: [PATCH 093/132] use convertPropertyToBooleanAndWriteBack in some generators (#4975) --- bin/dart-petstore.sh | 2 +- .../swagger/codegen/languages/BashClientCodegen.java | 12 +++--------- .../swagger/codegen/languages/DartClientCodegen.java | 11 +++++++++-- .../io/swagger/codegen/languages/Swift3Codegen.java | 9 ++++++--- .../io/swagger/codegen/languages/SwiftCodegen.java | 10 ++++++---- samples/client/petstore/dart/swagger/README.md | 1 - 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/bin/dart-petstore.sh b/bin/dart-petstore.sh index bfb9e8179f0..466a27b657b 100755 --- a/bin/dart-petstore.sh +++ b/bin/dart-petstore.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/dart -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/dart -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true" # then options to generate the library for vm would be: #ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm" diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java index edd4f52bc71..eae094e6335 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java @@ -201,21 +201,15 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { } if (additionalProperties.containsKey(PROCESS_MARKDOWN)) { - setProcessMarkdown( - Boolean.parseBoolean( - additionalProperties.get(PROCESS_MARKDOWN).toString())); + setProcessMarkdown(convertPropertyToBooleanAndWriteBack(PROCESS_MARKDOWN)); } if (additionalProperties.containsKey(GENERATE_BASH_COMPLETION)) { - setGenerateBashCompletion( - Boolean.parseBoolean( - additionalProperties.get(GENERATE_BASH_COMPLETION).toString())); + setGenerateBashCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_BASH_COMPLETION)); } if (additionalProperties.containsKey(GENERATE_ZSH_COMPLETION)) { - setGenerateZshCompletion( - Boolean.parseBoolean( - additionalProperties.get(GENERATE_ZSH_COMPLETION).toString())); + setGenerateZshCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_ZSH_COMPLETION)); } if (additionalProperties.containsKey(SCRIPT_NAME)) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java index d2a09a8ee3c..b85b1dd0151 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java @@ -117,8 +117,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { super.processOpts(); if (additionalProperties.containsKey(BROWSER_CLIENT)) { - this.setBrowserClient(Boolean.parseBoolean((String) additionalProperties.get(BROWSER_CLIENT))); - additionalProperties.put(BROWSER_CLIENT, browserClient); + this.setBrowserClient(convertPropertyToBooleanAndWriteBack(BROWSER_CLIENT)); } else { //not set, use to be passed to template additionalProperties.put(BROWSER_CLIENT, browserClient); @@ -149,6 +148,14 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } + // default HIDE_GENERATION_TIMESTAMP to true + if (!additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, Boolean.TRUE.toString()); + } else { + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, + Boolean.valueOf(additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP).toString())); + } + // make api and model doc path available in mustache template additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java index 626af3f8265..7c45302d43a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java @@ -185,7 +185,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(Boolean.parseBoolean(String.valueOf(additionalProperties.get(UNWRAP_REQUIRED)))); + setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); } additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); @@ -208,9 +208,8 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - swiftUseApiNamespace = Boolean.parseBoolean(String.valueOf(additionalProperties.get(SWIFT_USE_API_NAMESPACE))); + setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); } - additionalProperties.put(SWIFT_USE_API_NAMESPACE, swiftUseApiNamespace); if (!additionalProperties.containsKey(POD_AUTHORS)) { additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); @@ -497,6 +496,10 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { this.responseAs = responseAs; } + public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { + this.swiftUseApiNamespace = swiftUseApiNamespace; + } + @Override public String toEnumValue(String value, String datatype) { return String.valueOf(value); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java index 01fce85c3db..1a12f287471 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java @@ -184,9 +184,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(Boolean.parseBoolean(String.valueOf(additionalProperties.get(UNWRAP_REQUIRED)))); + setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); } - additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(RESPONSE_AS)) { @@ -207,9 +206,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - swiftUseApiNamespace = Boolean.parseBoolean(String.valueOf(additionalProperties.get(SWIFT_USE_API_NAMESPACE))); + setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); } - additionalProperties.put(SWIFT_USE_API_NAMESPACE, swiftUseApiNamespace); if (!additionalProperties.containsKey(POD_AUTHORS)) { additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); @@ -531,6 +529,10 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { this.responseAs = responseAs; } + public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { + this.swiftUseApiNamespace = swiftUseApiNamespace; + } + @Override public String toEnumValue(String value, String datatype) { if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { diff --git a/samples/client/petstore/dart/swagger/README.md b/samples/client/petstore/dart/swagger/README.md index 6998182066d..4ac75e49d78 100644 --- a/samples/client/petstore/dart/swagger/README.md +++ b/samples/client/petstore/dart/swagger/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. You can find out more about Swagger at This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Build date: 2017-03-02T21:05:05.222+01:00 - Build package: io.swagger.codegen.languages.DartClientCodegen ## Requirements From 2bb7626202633222a4ac2668f2bd23ffad17a9b4 Mon Sep 17 00:00:00 2001 From: Michael Kourlas Date: Wed, 8 Mar 2017 06:00:50 -0500 Subject: [PATCH 094/132] [Java] Fix for issue #3365: Support for gzip compression (#4967) * Fix for issue 3365 for Java * Added tests * Convert CRLF to LF * Convert CRLF to LF in tests --- .../codegen/languages/JavaClientCodegen.java | 20 ++++- .../main/resources/Java/ApiClient.mustache | 2 + .../libraries/okhttp-gson/ApiClient.mustache | 5 ++ .../GzipRequestInterceptor.mustache | 70 ++++++++++++++++ .../options/JavaClientOptionsProvider.java | 1 + .../java/io/swagger/client/ApiClient.java | 2 + .../java/io/swagger/client/ApiClient.java | 1 + .../client/GzipRequestInterceptor.java | 81 +++++++++++++++++++ 8 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 1285391cef5..b9152047f38 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -2,6 +2,7 @@ package io.swagger.codegen.languages; import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.GzipFeatures; import io.swagger.codegen.languages.features.PerformBeanValidationFeatures; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -13,7 +14,9 @@ import java.util.*; import java.util.regex.Pattern; public class JavaClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, PerformBeanValidationFeatures { + implements BeanValidationFeatures, PerformBeanValidationFeatures, + GzipFeatures +{ static final String MEDIA_TYPE = "mediaType"; @SuppressWarnings("hiding") @@ -36,6 +39,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean parcelableModel = false; protected boolean useBeanValidation = false; protected boolean performBeanValidation = false; + protected boolean useGzipFeature = false; public JavaClientCodegen() { super(); @@ -53,11 +57,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library.")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); + cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests")); - supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'."); + supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put("feign", "HTTP client: Netflix Feign 8.16.0. JSON processing: Jackson 2.7.0"); supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.22.2. JSON processing: Jackson 2.7.0"); - supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'"); + supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)"); @@ -119,6 +124,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.setPerformBeanValidation(convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION)); } + if (additionalProperties.containsKey(USE_GZIP_FEATURE)) { + this.setUseGzipFeature(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE)); + } + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/"); @@ -174,6 +183,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ProgressRequestBody.mustache", invokerFolder, "ProgressRequestBody.java")); supportingFiles.add(new SupportingFile("ProgressResponseBody.mustache", invokerFolder, "ProgressResponseBody.java")); + supportingFiles.add(new SupportingFile("GzipRequestInterceptor.mustache", invokerFolder, "GzipRequestInterceptor.java")); additionalProperties.put("gson", "true"); } else if (usesAnyRetrofitLibrary()) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); @@ -377,6 +387,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.performBeanValidation = performBeanValidation; } + public void setUseGzipFeature(boolean useGzipFeature) { + this.useGzipFeature = useGzipFeature; + } + final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?"); final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?"); diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 14a215eac4a..dac15cd9f83 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -15,6 +15,7 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter; import com.sun.jersey.api.client.filter.LoggingFilter; import com.sun.jersey.api.client.WebResource.Builder; @@ -110,6 +111,7 @@ public class ApiClient { DefaultClientConfig conf = new DefaultClientConfig(); conf.getSingletons().add(jsonProvider); Client client = Client.create(conf); + client.addFilter(new GZIPContentEncodingFilter({{#useGzipFeature}}true{{/useGzipFeature}}{{^useGzipFeature}}false{{/useGzipFeature}})); if (debugging) { client.addFilter(new LoggingFilter()); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 9c75d671607..a3f73d0b27b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -128,6 +128,11 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + {{#useGzipFeature}} + // Enable gzip request compression + httpClient.interceptors().add(new GzipRequestInterceptor()); + {{/useGzipFeature}} + verifyingSsl = true; json = new JSON(this); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache new file mode 100644 index 00000000000..23224cf5d5b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache @@ -0,0 +1,70 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java index cc0f3217403..3a4ddc208f8 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java @@ -23,6 +23,7 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider { options.put(JavaClientCodegen.SUPPORT_JAVA6, "false"); options.put(JavaClientCodegen.USE_BEANVALIDATION, "false"); options.put(JavaClientCodegen.PERFORM_BEANVALIDATION, PERFORM_BEANVALIDATION); + options.put(JavaClientCodegen.USE_GZIP_FEATURE, "false"); return options; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index de98188515a..90f05be0078 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -21,6 +21,7 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter; import com.sun.jersey.api.client.filter.LoggingFilter; import com.sun.jersey.api.client.WebResource.Builder; @@ -111,6 +112,7 @@ public class ApiClient { DefaultClientConfig conf = new DefaultClientConfig(); conf.getSingletons().add(jsonProvider); Client client = Client.create(conf); + client.addFilter(new GZIPContentEncodingFilter(false)); if (debugging) { client.addFilter(new LoggingFilter()); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index d014d7d4035..64e0e9a04a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -139,6 +139,7 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + verifyingSsl = true; json = new JSON(this); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..cc4e4f951c1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java @@ -0,0 +1,81 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file From d21e15607110dee19f55280ef5d95896a7228f64 Mon Sep 17 00:00:00 2001 From: baartosz Date: Wed, 8 Mar 2017 11:08:42 +0000 Subject: [PATCH 095/132] [PHP] error when deserializing enums #4032 (#4886) * fixed enum template; added enum handling to ObjectSerializer * regenerated templates * improved InvalidArgumentException message * regenerated sample client * added value check of OuterEnum during sanitization * regenerated samples --- .../resources/php/ObjectSerializer.mustache | 18 +++- .../src/main/resources/php/model.mustache | 2 + .../main/resources/php/model_enum.mustache | 12 +-- .../SwaggerClient-php/lib/Model/EnumClass.php | 20 +++- .../SwaggerClient-php/lib/Model/OuterEnum.php | 20 +++- .../lib/ObjectSerializer.php | 18 +++- .../SwaggerClient-php/tests/OuterEnumTest.php | 94 +++++++++++++++++++ 7 files changed, 164 insertions(+), 20 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 9550de6d193..2014eab8a99 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -49,10 +49,16 @@ class ObjectSerializer return $data; } elseif (is_object($data)) { $values = []; - foreach (array_keys($data::swaggerTypes()) as $property) { + foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; - if ($data->$getter() !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); + $value = $data->$getter(); + if (method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value); } } return (object)$values; @@ -259,6 +265,12 @@ class ObjectSerializer } return $deserialized; + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; } else { // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 9c4eab93107..2c1fc33e82e 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -20,8 +20,10 @@ */ namespace {{modelPackage}}; +{{^isEnum}} use \ArrayAccess; +{{/isEnum}} /** * {{classname}} Class Doc Comment diff --git a/modules/swagger-codegen/src/main/resources/php/model_enum.mustache b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache index c9250081b82..c34cfb3faac 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_enum.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache @@ -1,18 +1,18 @@ class {{classname}} { + /** + * Possible values of this enum + */ {{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}}; {{/enumVars}}{{/allowableValues}} - - {{#vars}}{{#isEnum}} /** * Gets allowable values of the enum * @return string[] */ - public function {{getter}}AllowableValues() + public static function getAllowableEnumValues() { return [ - {{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}} + {{#allowableValues}}{{#enumVars}}self::{{{name}}},{{^-last}} {{/-last}}{{/enumVars}}{{/allowableValues}} ]; } - {{/isEnum}}{{/vars}} -} \ No newline at end of file +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index 223e012b084..1e12ea14587 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -29,8 +29,6 @@ namespace Swagger\Client\Model; -use \ArrayAccess; - /** * EnumClass Class Doc Comment * @@ -40,11 +38,25 @@ use \ArrayAccess; * @link https://github.com/swagger-api/swagger-codegen */ class EnumClass { + /** + * Possible values of this enum + */ const ABC = '_abc'; const EFG = '-efg'; const XYZ = '(xyz)'; - - + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::ABC, + self::EFG, + self::XYZ, + ]; + } } + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php index b077a3b7b74..e1247e2423e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php @@ -29,8 +29,6 @@ namespace Swagger\Client\Model; -use \ArrayAccess; - /** * OuterEnum Class Doc Comment * @@ -40,11 +38,25 @@ use \ArrayAccess; * @link https://github.com/swagger-api/swagger-codegen */ class OuterEnum { + /** + * Possible values of this enum + */ const PLACED = 'placed'; const APPROVED = 'approved'; const DELIVERED = 'delivered'; - - + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::PLACED, + self::APPROVED, + self::DELIVERED, + ]; + } } + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index fbb2e8b1e45..281e51143b6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -59,10 +59,16 @@ class ObjectSerializer return $data; } elseif (is_object($data)) { $values = []; - foreach (array_keys($data::swaggerTypes()) as $property) { + foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; - if ($data->$getter() !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); + $value = $data->$getter(); + if (method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value); } } return (object)$values; @@ -269,6 +275,12 @@ class ObjectSerializer } return $deserialized; + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; } else { // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php new file mode 100644 index 00000000000..d7d12d5cbb8 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php @@ -0,0 +1,94 @@ +assertInternalType('string', $result); + $this->assertEquals('placed', $result); + } + + public function testDeserializeInvalidValue() + { + $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + + ObjectSerializer::deserialize( + "lkjfalgkdfjg", + OuterEnum::class + ); + } + + public function testDeserializeNested() + { + $json = '{ + "enum_string": "UPPER", + "enum_integer": -1, + "enum_number": -1.2, + "outerEnum": "approved" + }'; + + /** * @var EnumTest $result */ + $result = ObjectSerializer::deserialize( + json_decode($json), + EnumTest::class + ); + + $this->assertInstanceOf(EnumTest::class, $result); + $this->assertEquals('approved', $result->getOuterEnum()); + } + + public function testSanitize() + { + $json = "placed"; + + $result = ObjectSerializer::sanitizeForSerialization( + $json + ); + + $this->assertInternalType('string', $result); + } + + public function testSanitizeNested() + { + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'approved' + ]); + + $result = ObjectSerializer::sanitizeForSerialization( + $input + ); + + $this->assertInternalType('object', $result); + $this->assertInstanceOf(\stdClass::class, $result); + + $this->assertInternalType('string', $result->outerEnum); + $this->assertEquals('approved', $result->outerEnum); + } + + public function testSanitizeNestedInvalidValue() + { + $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'invalid_value' + ]); + + ObjectSerializer::sanitizeForSerialization($input); + } +} From b6d6356c469fe5548c012f35a6840b848187a8a0 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 8 Mar 2017 22:43:59 +0800 Subject: [PATCH 096/132] remove default format (json) from c# api (#4980) --- .../src/main/resources/csharp/api.mustache | 6 --- .../csharp/SwaggerClient/IO.Swagger.sln | 10 ++-- .../petstore/csharp/SwaggerClient/README.md | 2 +- .../src/IO.Swagger/Api/FakeApi.cs | 18 ------- .../src/IO.Swagger/Api/PetApi.cs | 48 ------------------- .../src/IO.Swagger/Api/StoreApi.cs | 24 ---------- .../src/IO.Swagger/Api/UserApi.cs | 48 ------------------- .../src/IO.Swagger/IO.Swagger.csproj | 2 +- .../IO.Swagger.sln | 10 ++-- .../README.md | 2 +- .../IO.Swagger.Test/IO.Swagger.Test.csproj | 2 +- .../src/IO.Swagger/Api/FakeApi.cs | 18 ------- .../src/IO.Swagger/Api/PetApi.cs | 48 ------------------- .../src/IO.Swagger/Api/StoreApi.cs | 24 ---------- .../src/IO.Swagger/Api/UserApi.cs | 48 ------------------- .../src/IO.Swagger/IO.Swagger.csproj | 2 +- 16 files changed, 15 insertions(+), 297 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index c3d73306149..b7e1afc4b5b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -234,9 +234,6 @@ namespace {{packageName}}.{{apiPackage}} if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); {{#pathParams}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} @@ -368,9 +365,6 @@ namespace {{packageName}}.{{apiPackage}} if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); {{#pathParams}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln index 4e593616590..e5ef60c1912 100644 --- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{45175ABF-4F24-48D0-B481-B1A2D9B8649E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{D445A874-7512-4B21-AC14-0CC1180C9B9A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{45175ABF-4F24-48D0-B481-B1A2D9B8649E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{45175ABF-4F24-48D0-B481-B1A2D9B8649E}.Debug|Any CPU.Build.0 = Debug|Any CPU -{45175ABF-4F24-48D0-B481-B1A2D9B8649E}.Release|Any CPU.ActiveCfg = Release|Any CPU -{45175ABF-4F24-48D0-B481-B1A2D9B8649E}.Release|Any CPU.Build.0 = Release|Any CPU +{D445A874-7512-4B21-AC14-0CC1180C9B9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{D445A874-7512-4B21-AC14-0CC1180C9B9A}.Debug|Any CPU.Build.0 = Debug|Any CPU +{D445A874-7512-4B21-AC14-0CC1180C9B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU +{D445A874-7512-4B21-AC14-0CC1180C9B9A}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index ab8b4d19139..e41e0d17a82 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -18,7 +18,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index 502deb884fd..127c5e582be 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -390,9 +390,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -469,9 +466,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -583,9 +577,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -711,9 +702,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -811,9 +799,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter @@ -900,9 +885,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs index d28c2e4fe2e..2ac2703b700 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -541,9 +541,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -627,9 +624,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -712,9 +706,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -792,9 +783,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -870,9 +858,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -948,9 +933,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -1025,9 +1007,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1103,9 +1082,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1180,9 +1156,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1258,9 +1231,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1335,9 +1305,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1421,9 +1388,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1509,9 +1473,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1593,9 +1554,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1676,9 +1634,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); @@ -1760,9 +1715,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs index c9c9461bc60..809f16f7239 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -347,9 +347,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -418,9 +415,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -483,9 +477,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -554,9 +545,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -629,9 +617,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -701,9 +686,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -772,9 +754,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -851,9 +830,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs index f05fc22dcca..281f116981c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs @@ -523,9 +523,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -601,9 +598,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -678,9 +672,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -756,9 +747,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -833,9 +821,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -911,9 +896,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -988,9 +970,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1059,9 +1038,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1130,9 +1106,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1202,9 +1175,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1278,9 +1248,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1356,9 +1323,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1422,9 +1386,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1487,9 +1448,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1561,9 +1519,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { @@ -1645,9 +1600,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj index e1d4f2f595d..5d56776fecb 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -11,7 +11,7 @@ Contact: apiteam@swagger.io Debug AnyCPU - {45175ABF-4F24-48D0-B481-B1A2D9B8649E} + {D445A874-7512-4B21-AC14-0CC1180C9B9A} Library Properties IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln index d5879e565e7..6faeeb36d23 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{5B61D15D-DCEB-42AF-89A6-6AE15FB9548F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{DA3C5AEB-7E43-42AF-838D-141FF1DDB66B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{5B61D15D-DCEB-42AF-89A6-6AE15FB9548F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{5B61D15D-DCEB-42AF-89A6-6AE15FB9548F}.Debug|Any CPU.Build.0 = Debug|Any CPU -{5B61D15D-DCEB-42AF-89A6-6AE15FB9548F}.Release|Any CPU.ActiveCfg = Release|Any CPU -{5B61D15D-DCEB-42AF-89A6-6AE15FB9548F}.Release|Any CPU.Build.0 = Release|Any CPU +{DA3C5AEB-7E43-42AF-838D-141FF1DDB66B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{DA3C5AEB-7E43-42AF-838D-141FF1DDB66B}.Debug|Any CPU.Build.0 = Debug|Any CPU +{DA3C5AEB-7E43-42AF-838D-141FF1DDB66B}.Release|Any CPU.ActiveCfg = Release|Any CPU +{DA3C5AEB-7E43-42AF-838D-141FF1DDB66B}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index ab8b4d19139..e41e0d17a82 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -18,7 +18,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj index 02c13c1a05b..0706f26970f 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -74,7 +74,7 @@ Contact: apiteam@swagger.io - {5B61D15D-DCEB-42AF-89A6-6AE15FB9548F} + {DA3C5AEB-7E43-42AF-838D-141FF1DDB66B} IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs index 502deb884fd..127c5e582be 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs @@ -390,9 +390,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -469,9 +466,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -583,9 +577,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -711,9 +702,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -811,9 +799,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter @@ -900,9 +885,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs index d28c2e4fe2e..2ac2703b700 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs @@ -541,9 +541,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -627,9 +624,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -712,9 +706,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -792,9 +783,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -870,9 +858,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -948,9 +933,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -1025,9 +1007,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1103,9 +1082,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1180,9 +1156,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1258,9 +1231,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1335,9 +1305,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1421,9 +1388,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1509,9 +1473,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1593,9 +1554,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1676,9 +1634,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); @@ -1760,9 +1715,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs index c9c9461bc60..809f16f7239 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs @@ -347,9 +347,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -418,9 +415,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -483,9 +477,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -554,9 +545,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -629,9 +617,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -701,9 +686,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -772,9 +754,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -851,9 +830,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs index f05fc22dcca..281f116981c 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs @@ -523,9 +523,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -601,9 +598,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -678,9 +672,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -756,9 +747,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -833,9 +821,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -911,9 +896,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -988,9 +970,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1059,9 +1038,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1130,9 +1106,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1202,9 +1175,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1278,9 +1248,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1356,9 +1323,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1422,9 +1386,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1487,9 +1448,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1561,9 +1519,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { @@ -1645,9 +1600,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj index f119b58e6d0..646b0653945 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj @@ -11,7 +11,7 @@ Contact: apiteam@swagger.io Debug AnyCPU - {5B61D15D-DCEB-42AF-89A6-6AE15FB9548F} + {DA3C5AEB-7E43-42AF-838D-141FF1DDB66B} Library Properties IO.Swagger From 4fe79f0078ca10d7296d740992bb7344a4854b0a Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 9 Mar 2017 11:12:01 +0800 Subject: [PATCH 097/132] Remove default format (JSON) from API operations (#4987) * remove default format (json) and update ruby petstore * update python petstore sample * update php petstore sample * update android petstore sample * update java petstore sample * update objc sample * remove default format (json) from perl --- .../src/main/resources/Java/api.mustache | 2 +- .../Java/libraries/jersey2/api.mustache | 2 +- .../Java/libraries/okhttp-gson/api.mustache | 4 +-- .../android/libraries/volley/api.mustache | 2 +- .../src/main/resources/objc/api-body.mustache | 3 --- .../src/main/resources/perl/api.mustache | 1 - .../src/main/resources/php/api.mustache | 3 --- .../src/main/resources/python/api.mustache | 3 +-- .../src/main/resources/ruby/api.mustache | 2 +- .../android/httpclient/docs/PetApi.md | 2 +- .../petstore/android/httpclient/pom.xml | 2 +- .../petstore/android/volley/docs/PetApi.md | 2 +- .../java/io/swagger/client/api/PetApi.java | 20 +++++++------- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/io/swagger/client/api/UserApi.java | 16 ++++++------ .../java/io/swagger/client/api/FakeApi.java | 6 ++--- .../java/io/swagger/client/api/PetApi.java | 16 ++++++------ .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/io/swagger/client/api/UserApi.java | 16 ++++++------ .../java/io/swagger/client/api/FakeApi.java | 6 ++--- .../java/io/swagger/client/api/PetApi.java | 16 ++++++------ .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/io/swagger/client/api/UserApi.java | 16 ++++++------ .../client/petstore/java/jersey2/git_push.sh | 6 ++--- .../java/io/swagger/client/api/FakeApi.java | 6 ++--- .../java/io/swagger/client/api/PetApi.java | 16 ++++++------ .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/io/swagger/client/api/UserApi.java | 16 ++++++------ .../java/io/swagger/client/api/FakeApi.java | 6 ++--- .../java/io/swagger/client/api/PetApi.java | 24 ++++++++--------- .../java/io/swagger/client/api/StoreApi.java | 12 ++++----- .../java/io/swagger/client/api/UserApi.java | 22 ++++++++-------- .../java/io/swagger/client/api/FakeApi.java | 1 + .../java/io/swagger/client/api/PetApi.java | 1 + .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 1 + .../io/swagger/client/model/FormatTest.java | 26 +++++-------------- .../java/io/swagger/client/ApiClient.java | 2 ++ .../java/io/swagger/client/api/FakeApi.java | 1 + .../java/io/swagger/client/api/PetApi.java | 1 + .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 1 + .../java/io/swagger/client/ApiClient.java | 2 ++ .../java/io/swagger/client/api/FakeApi.java | 1 + .../java/io/swagger/client/api/PetApi.java | 1 + .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 1 + .../default/SwaggerClient/Api/SWGPetApi.m | 24 ----------------- .../default/SwaggerClient/Api/SWGStoreApi.m | 12 --------- .../default/SwaggerClient/Api/SWGUserApi.m | 24 ----------------- .../perl/lib/WWW/SwaggerClient/FakeApi.pm | 3 --- .../perl/lib/WWW/SwaggerClient/PetApi.pm | 8 ------ .../perl/lib/WWW/SwaggerClient/StoreApi.pm | 4 --- .../perl/lib/WWW/SwaggerClient/UserApi.pm | 8 ------ .../php/SwaggerClient-php/lib/Api/FakeApi.php | 9 ------- .../php/SwaggerClient-php/lib/Api/PetApi.php | 24 ----------------- .../SwaggerClient-php/lib/Api/StoreApi.php | 12 --------- .../php/SwaggerClient-php/lib/Api/UserApi.php | 24 ----------------- .../python/petstore_api/apis/fake_api.py | 9 +++---- .../python/petstore_api/apis/pet_api.py | 24 ++++++----------- .../python/petstore_api/apis/store_api.py | 12 +++------ .../python/petstore_api/apis/user_api.py | 24 ++++++----------- .../ruby/lib/petstore/api/fake_api.rb | 6 ++--- .../petstore/ruby/lib/petstore/api/pet_api.rb | 16 ++++++------ .../ruby/lib/petstore/api/store_api.rb | 8 +++--- .../ruby/lib/petstore/api/user_api.rb | 16 ++++++------ 66 files changed, 205 insertions(+), 384 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/api.mustache b/modules/swagger-codegen/src/main/resources/Java/api.mustache index 5bf40a593f0..6903f4dec7c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/api.mustache @@ -62,7 +62,7 @@ public class {{classname}} { } {{/required}}{{/allParams}} // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache index 531e56e6d4c..63df83ee24b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache @@ -59,7 +59,7 @@ public class {{classname}} { } {{/required}}{{/allParams}} // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 0cd19c24efa..a6f66172c01 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -68,8 +68,8 @@ public class {{classname}} { Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; {{javaUtilPrefix}}List {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList();{{#queryParams}} if ({{paramName}} != null) diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache index 288408ab26c..cbcbc96e3b1 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache @@ -66,7 +66,7 @@ public class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params List queryParams = new ArrayList(); diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 80a047b80b2..6f5ce7267fa 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -79,9 +79,6 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{/allParams}} NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"{{path}}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; {{#pathParams}} if ({{paramName}} != nil) { diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index b7f2dd039ca..d7b17fb9d8a 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -79,7 +79,6 @@ sub {{operationId}} { {{/allParams}} # parse inputs my $_resource_path = '{{path}}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = '{{httpMethod}}'; my $query_params = {}; diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index bfbb6fca373..2c0e2acb7f0 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -211,9 +211,6 @@ use \{{invokerPackage}}\ObjectSerializer; ); } {{/pathParams}} - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - {{#formParams}} // form params if (${{paramName}} !== null) { diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 0088f2bcec7..a8a0563b295 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -161,7 +161,6 @@ class {{classname}}(object): {{/allParams}} collection_formats = {} - resource_path = '{{path}}'.replace('{format}', 'json') path_params = {} {{#pathParams}} if '{{paramName}}' in params: @@ -211,7 +210,7 @@ class {{classname}}(object): # Authentication setting auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - return self.api_client.call_api(resource_path, '{{httpMethod}}', + return self.api_client.call_api('{{path}}', '{{httpMethod}}', path_params, query_params, header_params, diff --git a/modules/swagger-codegen/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache index faf2562fde9..fc9d2905635 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api.mustache @@ -108,7 +108,7 @@ module {{moduleName}} {{/hasValidation}} {{/allParams}} # resource path - local_var_path = "{{{path}}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} + local_var_path = "{{{path}}}"{{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} # query parameters query_params = {} diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index e7b393c8ea7..ff596b3d918 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -222,7 +222,7 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index a9bff313266..5ba936a5701 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -145,7 +145,7 @@ - 1.5.9 + 1.5.12 2.3.1 4.8.1 1.0.0 diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index e7b393c8ea7..ff596b3d918 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -222,7 +222,7 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java index 644a15c5da3..557c97a958f 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java @@ -66,7 +66,7 @@ public class PetApi { Object postBody = body; // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet"; // query params List queryParams = new ArrayList(); @@ -188,7 +188,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -310,7 +310,7 @@ public class PetApi { Object postBody = null; // create path and map variables - String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String path = "/pet/findByStatus"; // query params List queryParams = new ArrayList(); @@ -430,7 +430,7 @@ public class PetApi { Object postBody = null; // create path and map variables - String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String path = "/pet/findByTags"; // query params List queryParams = new ArrayList(); @@ -555,7 +555,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -576,7 +576,7 @@ public class PetApi { // normal form params } - String[] authNames = new String[] { "api_key", "petstore_auth" }; + String[] authNames = new String[] { "petstore_auth", "api_key" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -646,7 +646,7 @@ public class PetApi { // normal form params } - String[] authNames = new String[] { "api_key", "petstore_auth" }; + String[] authNames = new String[] { "petstore_auth", "api_key" }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -679,7 +679,7 @@ public class PetApi { Object postBody = body; // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet"; // query params List queryParams = new ArrayList(); @@ -802,7 +802,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -948,7 +948,7 @@ formParams.put("status", ApiInvoker.parameterToString(status)); } // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java index 1aac5e84fa5..16cd37138fe 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java @@ -71,7 +71,7 @@ public class StoreApi { } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params List queryParams = new ArrayList(); @@ -190,7 +190,7 @@ public class StoreApi { Object postBody = null; // create path and map variables - String path = "/store/inventory".replaceAll("\\{format\\}","json"); + String path = "/store/inventory"; // query params List queryParams = new ArrayList(); @@ -313,7 +313,7 @@ public class StoreApi { } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params List queryParams = new ArrayList(); @@ -437,7 +437,7 @@ public class StoreApi { Object postBody = body; // create path and map variables - String path = "/store/order".replaceAll("\\{format\\}","json"); + String path = "/store/order"; // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java index 0857956f749..83bdcbd8305 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java @@ -66,7 +66,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); + String path = "/user"; // query params List queryParams = new ArrayList(); @@ -180,7 +180,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String path = "/user/createWithArray"; // query params List queryParams = new ArrayList(); @@ -294,7 +294,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + String path = "/user/createWithList"; // query params List queryParams = new ArrayList(); @@ -413,7 +413,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); @@ -538,7 +538,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); @@ -663,7 +663,7 @@ public class UserApi { Object postBody = null; // create path and map variables - String path = "/user/login".replaceAll("\\{format\\}","json"); + String path = "/user/login"; // query params List queryParams = new ArrayList(); @@ -784,7 +784,7 @@ public class UserApi { Object postBody = null; // create path and map variables - String path = "/user/logout".replaceAll("\\{format\\}","json"); + String path = "/user/logout"; // query params List queryParams = new ArrayList(); @@ -904,7 +904,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java index d917239a65e..db1a0e3c2ef 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java @@ -67,7 +67,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -135,7 +135,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -205,7 +205,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java index 2d67203c51e..63095c199cd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java @@ -65,7 +65,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -106,7 +106,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -150,7 +150,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -192,7 +192,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -234,7 +234,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -275,7 +275,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -317,7 +317,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -365,7 +365,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java index 74bd29b88b0..48d7c58de7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java @@ -63,7 +63,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -99,7 +99,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -140,7 +140,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -182,7 +182,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java index b2e57a05aaa..ce5ebd56cf3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java @@ -63,7 +63,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -103,7 +103,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -143,7 +143,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -183,7 +183,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -225,7 +225,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -273,7 +273,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -309,7 +309,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -355,7 +355,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java index 7b33209b8cc..974daecfc97 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java @@ -53,7 +53,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -121,7 +121,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -191,7 +191,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java index e816fce5bad..c8f8b730ca5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java @@ -51,7 +51,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -92,7 +92,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -136,7 +136,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -178,7 +178,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -220,7 +220,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -261,7 +261,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -303,7 +303,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -351,7 +351,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java index 41bd6751871..d0a1e843743 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,7 +49,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -85,7 +85,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -126,7 +126,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -168,7 +168,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java index 7602f4e2ba9..a7dced63d85 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java @@ -49,7 +49,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -89,7 +89,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -129,7 +129,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -169,7 +169,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -211,7 +211,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -259,7 +259,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -295,7 +295,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -341,7 +341,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/jersey2/git_push.sh b/samples/client/petstore/java/jersey2/git_push.sh index 6ca091b49d9..ed374619b13 100644 --- a/samples/client/petstore/java/jersey2/git_push.sh +++ b/samples/client/petstore/java/jersey2/git_push.sh @@ -8,17 +8,17 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="" + git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="" + git_repo_id="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="" + release_note="Minor update" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java index 1bc9d46a7b6..a8c2ebfa2b7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java @@ -53,7 +53,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -121,7 +121,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -191,7 +191,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java index e816fce5bad..c8f8b730ca5 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java @@ -51,7 +51,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -92,7 +92,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -136,7 +136,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -178,7 +178,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -220,7 +220,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -261,7 +261,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -303,7 +303,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -351,7 +351,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java index 41bd6751871..d0a1e843743 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,7 +49,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -85,7 +85,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -126,7 +126,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -168,7 +168,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java index 7602f4e2ba9..a7dced63d85 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java @@ -49,7 +49,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -89,7 +89,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -129,7 +129,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -169,7 +169,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -211,7 +211,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -259,7 +259,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -295,7 +295,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -341,7 +341,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java index d11b40fa058..8cebf9d6d31 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -62,7 +62,7 @@ public class FakeApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -180,7 +180,7 @@ public class FakeApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -376,7 +376,7 @@ public class FakeApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); if (enumQueryStringArray != null) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java index b7119add7d1..c428968e398 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java @@ -61,7 +61,7 @@ public class PetApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -175,8 +175,8 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -295,7 +295,7 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); if (status != null) @@ -415,7 +415,7 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); if (tags != null) @@ -535,8 +535,8 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -654,7 +654,7 @@ public class PetApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -768,8 +768,8 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -893,8 +893,8 @@ public class PetApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index 199f2c7b109..f6027e22803 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -59,8 +59,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -174,7 +174,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; List localVarQueryParams = new ArrayList(); @@ -284,8 +284,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -403,7 +403,7 @@ public class StoreApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java index ea719996a6b..1b2c0130d88 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java @@ -59,7 +59,7 @@ public class UserApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; List localVarQueryParams = new ArrayList(); @@ -173,7 +173,7 @@ public class UserApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; List localVarQueryParams = new ArrayList(); @@ -287,7 +287,7 @@ public class UserApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; List localVarQueryParams = new ArrayList(); @@ -401,8 +401,8 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -516,8 +516,8 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -635,7 +635,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; List localVarQueryParams = new ArrayList(); if (username != null) @@ -765,7 +765,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; List localVarQueryParams = new ArrayList(); @@ -871,8 +871,8 @@ public class UserApi { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java index 3dec8d367e7..c28161906f4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java index ec44297e20e..7b32044e838 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java index d2e38f90cbf..2ffc90a478b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java index 7034b3ab5b9..19fc25ccd23 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index d060850d48a..8beb242e21d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -79,9 +79,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) - @Max(100) - @ApiModelProperty(example = "null", value = "") + @Min(10) @Max(100) @ApiModelProperty(example = "null", value = "") public Integer getInteger() { return integer; } @@ -101,9 +99,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) - @Max(200) - @ApiModelProperty(example = "null", value = "") + @Min(20) @Max(200) @ApiModelProperty(example = "null", value = "") public Integer getInt32() { return int32; } @@ -142,9 +138,7 @@ public class FormatTest { * @return number **/ @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - @ApiModelProperty(example = "null", required = true, value = "") + @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(example = "null", required = true, value = "") public BigDecimal getNumber() { return number; } @@ -164,9 +158,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") - @DecimalMax("987.6") - @ApiModelProperty(example = "null", value = "") + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(example = "null", value = "") public Float getFloat() { return _float; } @@ -186,9 +178,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") - @DecimalMax("123.4") - @ApiModelProperty(example = "null", value = "") + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(example = "null", value = "") public Double getDouble() { return _double; } @@ -206,8 +196,7 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") - @ApiModelProperty(example = "null", value = "") + @Pattern(regexp="/[a-z]/i") @ApiModelProperty(example = "null", value = "") public String getString() { return string; } @@ -318,8 +307,7 @@ public class FormatTest { * @return password **/ @NotNull - @Size(min=10,max=64) - @ApiModelProperty(example = "null", required = true, value = "") + @Size(min=10,max=64) @ApiModelProperty(example = "null", required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java index 99586dcab59..bd9a00b5014 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java @@ -16,6 +16,7 @@ import org.joda.time.format.ISODateTimeFormat; import retrofit2.Converter; import retrofit2.Retrofit; + import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; @@ -129,6 +130,7 @@ public class ApiClient { .Builder() .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 94820a21964..ef1ffe54aab 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; 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 0860d5354ed..df1999db5c0 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 @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; 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 f2d3a26d0ed..224d4f02500 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 @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; 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 87a4921c70e..2a189ac4e60 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 @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java index e3436cf56d0..1526ca00e37 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java @@ -16,6 +16,7 @@ import org.joda.time.format.ISODateTimeFormat; import retrofit2.Converter; import retrofit2.Retrofit; import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; + import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; @@ -129,6 +130,7 @@ public class ApiClient { .Builder() .baseUrl(baseUrl) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 41b5a883596..53949384763 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; 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 7d036572540..3fa5d01ee65 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 @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; 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 847c2721144..5c87a20f433 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 @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; 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 af1bb5f0ffd..79428c2ad04 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 @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index c0ca97c3480..36a2a6d700a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -60,9 +60,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -132,9 +129,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -195,9 +189,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -256,9 +247,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -328,9 +316,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -388,9 +373,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -463,9 +445,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -546,9 +525,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index 2a17173f83a..ebf27ab982a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -71,9 +71,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (orderId != nil) { pathParams[@"orderId"] = orderId; @@ -129,9 +126,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -197,9 +191,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (orderId != nil) { pathParams[@"orderId"] = orderId; @@ -257,9 +248,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index e1acf3af007..2a1c4ecda81 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -60,9 +60,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -118,9 +115,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -176,9 +170,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -245,9 +236,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; @@ -316,9 +304,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; @@ -379,9 +364,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSString* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -440,9 +422,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -511,9 +490,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm index ebb8bb5b86e..961e102e081 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -83,7 +83,6 @@ sub test_client_model { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PATCH'; my $query_params = {}; @@ -242,7 +241,6 @@ sub test_endpoint_parameters { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -406,7 +404,6 @@ sub test_enum_parameters { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index ac715bb60bf..c658538dac6 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -83,7 +83,6 @@ sub add_pet { # parse inputs my $_resource_path = '/pet'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -151,7 +150,6 @@ sub delete_pet { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -220,7 +218,6 @@ sub find_pets_by_status { # parse inputs my $_resource_path = '/pet/findByStatus'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -286,7 +283,6 @@ sub find_pets_by_tags { # parse inputs my $_resource_path = '/pet/findByTags'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -352,7 +348,6 @@ sub get_pet_by_id { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -420,7 +415,6 @@ sub update_pet { # parse inputs my $_resource_path = '/pet'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PUT'; my $query_params = {}; @@ -494,7 +488,6 @@ sub update_pet_with_form { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -580,7 +573,6 @@ sub upload_file { # parse inputs my $_resource_path = '/pet/{petId}/uploadImage'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index ee508043e54..87589c7a7ec 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -83,7 +83,6 @@ sub delete_order { # parse inputs my $_resource_path = '/store/order/{orderId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -136,7 +135,6 @@ sub get_inventory { # parse inputs my $_resource_path = '/store/inventory'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -197,7 +195,6 @@ sub get_order_by_id { # parse inputs my $_resource_path = '/store/order/{orderId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -265,7 +262,6 @@ sub place_order { # parse inputs my $_resource_path = '/store/order'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index 13f2e705272..c0312e5d231 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -83,7 +83,6 @@ sub create_user { # parse inputs my $_resource_path = '/user'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -145,7 +144,6 @@ sub create_users_with_array_input { # parse inputs my $_resource_path = '/user/createWithArray'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -207,7 +205,6 @@ sub create_users_with_list_input { # parse inputs my $_resource_path = '/user/createWithList'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -269,7 +266,6 @@ sub delete_user { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -333,7 +329,6 @@ sub get_user_by_name { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -412,7 +407,6 @@ sub login_user { # parse inputs my $_resource_path = '/user/login'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -472,7 +466,6 @@ sub logout_user { # parse inputs my $_resource_path = '/user/logout'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -540,7 +533,6 @@ sub update_user { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PUT'; my $query_params = {}; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index 54522e7a792..7024bdb6820 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -129,9 +129,6 @@ class FakeApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -296,9 +293,6 @@ class FakeApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/xml; charset=utf-8', 'application/json; charset=utf-8']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($integer !== null) { $formParams['integer'] = $this->apiClient->getSerializer()->toFormValue($integer); @@ -465,9 +459,6 @@ class FakeApi if ($enum_header_string !== null) { $headerParams['enum_header_string'] = $this->apiClient->getSerializer()->toHeaderValue($enum_header_string); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($enum_form_string_array !== null) { $formParams['enum_form_string_array'] = $this->apiClient->getSerializer()->toFormValue($enum_form_string_array); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index cb902068dd4..2a83fec174f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -129,9 +129,6 @@ class PetApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -225,9 +222,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -309,9 +303,6 @@ class PetApi if ($status !== null) { $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -397,9 +388,6 @@ class PetApi if ($tags !== null) { $queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -486,9 +474,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -568,9 +553,6 @@ class PetApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -662,9 +644,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($name !== null) { $formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name); @@ -759,9 +738,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($additional_metadata !== null) { $formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 655fb65737a..e3d7e466722 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -137,9 +137,6 @@ class StoreApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -204,9 +201,6 @@ class StoreApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -301,9 +295,6 @@ class StoreApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -378,9 +369,6 @@ class StoreApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 31580e1b3c1..8d893d055ec 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -129,9 +129,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -207,9 +204,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -285,9 +279,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -371,9 +362,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -452,9 +440,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -543,9 +528,6 @@ class UserApi if ($password !== null) { $queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -614,9 +596,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -701,9 +680,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { diff --git a/samples/client/petstore/python/petstore_api/apis/fake_api.py b/samples/client/petstore/python/petstore_api/apis/fake_api.py index 95fc5c69362..c4563b41c75 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python/petstore_api/apis/fake_api.py @@ -108,7 +108,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -132,7 +131,7 @@ class FakeApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'PATCH', + return self.api_client.call_api('/fake', 'PATCH', path_params, query_params, header_params, @@ -276,7 +275,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -326,7 +324,7 @@ class FakeApi(object): # Authentication setting auth_settings = ['http_basic_test'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/fake', 'POST', path_params, query_params, header_params, @@ -420,7 +418,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -461,7 +458,7 @@ class FakeApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/fake', 'GET', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/pet_api.py b/samples/client/petstore/python/petstore_api/apis/pet_api.py index d3d5e96025a..4cca462f7db 100644 --- a/samples/client/petstore/python/petstore_api/apis/pet_api.py +++ b/samples/client/petstore/python/petstore_api/apis/pet_api.py @@ -108,7 +108,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet'.replace('{format}', 'json') path_params = {} query_params = {} @@ -132,7 +131,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet', 'POST', path_params, query_params, header_params, @@ -217,7 +216,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -239,7 +237,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/pet/{petId}', 'DELETE', path_params, query_params, header_params, @@ -322,7 +320,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/findByStatus'.replace('{format}', 'json') path_params = {} query_params = {} @@ -343,7 +340,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/findByStatus', 'GET', path_params, query_params, header_params, @@ -426,7 +423,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/findByTags'.replace('{format}', 'json') path_params = {} query_params = {} @@ -447,7 +443,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/findByTags', 'GET', path_params, query_params, header_params, @@ -530,7 +526,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -550,7 +545,7 @@ class PetApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/{petId}', 'GET', path_params, query_params, header_params, @@ -633,7 +628,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet'.replace('{format}', 'json') path_params = {} query_params = {} @@ -657,7 +651,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'PUT', + return self.api_client.call_api('/pet', 'PUT', path_params, query_params, header_params, @@ -744,7 +738,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -772,7 +765,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet/{petId}', 'POST', path_params, query_params, header_params, @@ -859,7 +852,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -887,7 +879,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/store_api.py b/samples/client/petstore/python/petstore_api/apis/store_api.py index 7bfe115b10e..c3f1b7f77bd 100644 --- a/samples/client/petstore/python/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python/petstore_api/apis/store_api.py @@ -108,7 +108,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -128,7 +127,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/store/order/{orderId}', 'DELETE', path_params, query_params, header_params, @@ -205,7 +204,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/inventory'.replace('{format}', 'json') path_params = {} query_params = {} @@ -223,7 +221,7 @@ class StoreApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/store/inventory', 'GET', path_params, query_params, header_params, @@ -310,7 +308,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -330,7 +327,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/store/order/{orderId}', 'GET', path_params, query_params, header_params, @@ -413,7 +410,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order'.replace('{format}', 'json') path_params = {} query_params = {} @@ -433,7 +429,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/store/order', 'POST', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/user_api.py b/samples/client/petstore/python/petstore_api/apis/user_api.py index 6b620aa63af..5fe1fb6f2a4 100644 --- a/samples/client/petstore/python/petstore_api/apis/user_api.py +++ b/samples/client/petstore/python/petstore_api/apis/user_api.py @@ -108,7 +108,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user'.replace('{format}', 'json') path_params = {} query_params = {} @@ -128,7 +127,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user', 'POST', path_params, query_params, header_params, @@ -211,7 +210,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/createWithArray'.replace('{format}', 'json') path_params = {} query_params = {} @@ -231,7 +229,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user/createWithArray', 'POST', path_params, query_params, header_params, @@ -314,7 +312,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/createWithList'.replace('{format}', 'json') path_params = {} query_params = {} @@ -334,7 +331,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user/createWithList', 'POST', path_params, query_params, header_params, @@ -417,7 +414,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -437,7 +433,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/user/{username}', 'DELETE', path_params, query_params, header_params, @@ -520,7 +516,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -540,7 +535,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/{username}', 'GET', path_params, query_params, header_params, @@ -628,7 +623,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/login'.replace('{format}', 'json') path_params = {} query_params = {} @@ -650,7 +644,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/login', 'GET', path_params, query_params, header_params, @@ -727,7 +721,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/logout'.replace('{format}', 'json') path_params = {} query_params = {} @@ -745,7 +738,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/logout', 'GET', path_params, query_params, header_params, @@ -833,7 +826,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -855,7 +847,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'PUT', + return self.api_client.call_api('/user/{username}', 'PUT', path_params, query_params, header_params, diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 403705d2746..932201de831 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" if body.nil? # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} @@ -178,7 +178,7 @@ module Petstore end # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} @@ -274,7 +274,7 @@ module Petstore fail ArgumentError, 'invalid value for "enum_query_string", must be one of _abc, -efg, (xyz)' end # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index f6ca76d10b0..39ea74058b3 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" if body.nil? # resource path - local_var_path = "/pet".sub('{format}','json') + local_var_path = "/pet" # query parameters query_params = {} @@ -95,7 +95,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore # verify the required parameter 'status' is set fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" if status.nil? # resource path - local_var_path = "/pet/findByStatus".sub('{format}','json') + local_var_path = "/pet/findByStatus" # query parameters query_params = {} @@ -198,7 +198,7 @@ module Petstore # verify the required parameter 'tags' is set fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" if tags.nil? # resource path - local_var_path = "/pet/findByTags".sub('{format}','json') + local_var_path = "/pet/findByTags" # query parameters query_params = {} @@ -250,7 +250,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -301,7 +301,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" if body.nil? # resource path - local_var_path = "/pet".sub('{format}','json') + local_var_path = "/pet" # query parameters query_params = {} @@ -357,7 +357,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -415,7 +415,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}/uploadImage".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}/uploadImage".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 30e2a46dfac..6b8978f1b9e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" if order_id.nil? # resource path - local_var_path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) # query parameters query_params = {} @@ -87,7 +87,7 @@ module Petstore @api_client.config.logger.debug "Calling API: StoreApi.get_inventory ..." end # resource path - local_var_path = "/store/inventory".sub('{format}','json') + local_var_path = "/store/inventory" # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore end # resource path - local_var_path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) # query parameters query_params = {} @@ -197,7 +197,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" if body.nil? # resource path - local_var_path = "/store/order".sub('{format}','json') + local_var_path = "/store/order" # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 30766994678..3bb8b2130d7 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" if body.nil? # resource path - local_var_path = "/user".sub('{format}','json') + local_var_path = "/user" # query parameters query_params = {} @@ -91,7 +91,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" if body.nil? # resource path - local_var_path = "/user/createWithArray".sub('{format}','json') + local_var_path = "/user/createWithArray" # query parameters query_params = {} @@ -141,7 +141,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" if body.nil? # resource path - local_var_path = "/user/createWithList".sub('{format}','json') + local_var_path = "/user/createWithList" # query parameters query_params = {} @@ -191,7 +191,7 @@ module Petstore # verify the required parameter 'username' is set fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" if username.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} @@ -241,7 +241,7 @@ module Petstore # verify the required parameter 'username' is set fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" if username.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} @@ -296,7 +296,7 @@ module Petstore # verify the required parameter 'password' is set fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" if password.nil? # resource path - local_var_path = "/user/login".sub('{format}','json') + local_var_path = "/user/login" # query parameters query_params = {} @@ -345,7 +345,7 @@ module Petstore @api_client.config.logger.debug "Calling API: UserApi.logout_user ..." end # resource path - local_var_path = "/user/logout".sub('{format}','json') + local_var_path = "/user/logout" # query parameters query_params = {} @@ -399,7 +399,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" if body.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} From cffaaa027adb2ddb32ed7e29dda3f1f777dff3b3 Mon Sep 17 00:00:00 2001 From: baartosz Date: Thu, 9 Mar 2017 09:28:19 +0000 Subject: [PATCH 098/132] minor improvements to Configuration php template (#4989) --- .../main/resources/php/configuration.mustache | 51 ++++++++++--------- .../SwaggerClient-php/lib/Configuration.php | 51 ++++++++++--------- 2 files changed, 56 insertions(+), 46 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index d409c625cda..bc3548a5019 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -29,7 +29,7 @@ namespace {{invokerPackage}}; */ class Configuration { - private static $defaultConfiguration = null; + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -99,7 +99,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}"; + protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; /** * Debug switch (default set to false) @@ -181,7 +181,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $key API key or token * - * @return Configuration + * @return $this */ public function setApiKey($apiKeyIdentifier, $key) { @@ -207,7 +207,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $prefix API key prefix, e.g. Bearer * - * @return Configuration + * @return $this */ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { @@ -232,7 +232,7 @@ class Configuration * * @param string $accessToken Token for OAuth * - * @return Configuration + * @return $this */ public function setAccessToken($accessToken) { @@ -255,7 +255,7 @@ class Configuration * * @param string $username Username for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setUsername($username) { @@ -278,7 +278,7 @@ class Configuration * * @param string $password Password for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setPassword($password) { @@ -302,7 +302,8 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function addDefaultHeader($headerName, $headerValue) { @@ -329,11 +330,12 @@ class Configuration * * @param string $headerName the header to delete * - * @return Configuration + * @return $this */ public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); + return $this; } /** @@ -341,7 +343,7 @@ class Configuration * * @param string $host Host * - * @return Configuration + * @return $this */ public function setHost($host) { @@ -364,7 +366,8 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -391,7 +394,8 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlTimeout($seconds) { @@ -418,7 +422,8 @@ class Configuration * * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlConnectTimeout($seconds) { @@ -446,7 +451,7 @@ class Configuration * * @param string $proxyHost HTTP Proxy URL * - * @return ApiClient + * @return $this */ public function setCurlProxyHost($proxyHost) { @@ -469,7 +474,7 @@ class Configuration * * @param integer $proxyPort HTTP Proxy Port * - * @return ApiClient + * @return $this */ public function setCurlProxyPort($proxyPort) { @@ -492,7 +497,7 @@ class Configuration * * @param integer $proxyType HTTP Proxy Type * - * @return ApiClient + * @return $this */ public function setCurlProxyType($proxyType) { @@ -515,7 +520,7 @@ class Configuration * * @param string $proxyUser HTTP Proxy User * - * @return ApiClient + * @return $this */ public function setCurlProxyUser($proxyUser) { @@ -538,7 +543,7 @@ class Configuration * * @param string $proxyPassword HTTP Proxy Password * - * @return ApiClient + * @return $this */ public function setCurlProxyPassword($proxyPassword) { @@ -561,7 +566,7 @@ class Configuration * * @param bool $debug Debug flag * - * @return Configuration + * @return $this */ public function setDebug($debug) { @@ -584,7 +589,7 @@ class Configuration * * @param string $debugFile Debug file * - * @return Configuration + * @return $this */ public function setDebugFile($debugFile) { @@ -607,7 +612,7 @@ class Configuration * * @param string $tempFolderPath Temp folder path * - * @return Configuration + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -630,7 +635,7 @@ class Configuration * * @param boolean $sslVerification True if the certificate should be validated, false otherwise * - * @return Configuration + * @return $this */ public function setSSLVerification($sslVerification) { @@ -683,7 +688,7 @@ class Configuration { $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL; {{#artifactVersion}} $report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index cc6875156cf..4bd9a69cdd8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -39,7 +39,7 @@ namespace Swagger\Client; */ class Configuration { - private static $defaultConfiguration = null; + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -109,7 +109,7 @@ class Configuration * * @var string */ - protected $userAgent = "Swagger-Codegen/1.0.0/php"; + protected $userAgent = 'Swagger-Codegen/1.0.0/php'; /** * Debug switch (default set to false) @@ -191,7 +191,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $key API key or token * - * @return Configuration + * @return $this */ public function setApiKey($apiKeyIdentifier, $key) { @@ -217,7 +217,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $prefix API key prefix, e.g. Bearer * - * @return Configuration + * @return $this */ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { @@ -242,7 +242,7 @@ class Configuration * * @param string $accessToken Token for OAuth * - * @return Configuration + * @return $this */ public function setAccessToken($accessToken) { @@ -265,7 +265,7 @@ class Configuration * * @param string $username Username for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setUsername($username) { @@ -288,7 +288,7 @@ class Configuration * * @param string $password Password for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setPassword($password) { @@ -312,7 +312,8 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function addDefaultHeader($headerName, $headerValue) { @@ -339,11 +340,12 @@ class Configuration * * @param string $headerName the header to delete * - * @return Configuration + * @return $this */ public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); + return $this; } /** @@ -351,7 +353,7 @@ class Configuration * * @param string $host Host * - * @return Configuration + * @return $this */ public function setHost($host) { @@ -374,7 +376,8 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -401,7 +404,8 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlTimeout($seconds) { @@ -428,7 +432,8 @@ class Configuration * * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlConnectTimeout($seconds) { @@ -456,7 +461,7 @@ class Configuration * * @param string $proxyHost HTTP Proxy URL * - * @return ApiClient + * @return $this */ public function setCurlProxyHost($proxyHost) { @@ -479,7 +484,7 @@ class Configuration * * @param integer $proxyPort HTTP Proxy Port * - * @return ApiClient + * @return $this */ public function setCurlProxyPort($proxyPort) { @@ -502,7 +507,7 @@ class Configuration * * @param integer $proxyType HTTP Proxy Type * - * @return ApiClient + * @return $this */ public function setCurlProxyType($proxyType) { @@ -525,7 +530,7 @@ class Configuration * * @param string $proxyUser HTTP Proxy User * - * @return ApiClient + * @return $this */ public function setCurlProxyUser($proxyUser) { @@ -548,7 +553,7 @@ class Configuration * * @param string $proxyPassword HTTP Proxy Password * - * @return ApiClient + * @return $this */ public function setCurlProxyPassword($proxyPassword) { @@ -571,7 +576,7 @@ class Configuration * * @param bool $debug Debug flag * - * @return Configuration + * @return $this */ public function setDebug($debug) { @@ -594,7 +599,7 @@ class Configuration * * @param string $debugFile Debug file * - * @return Configuration + * @return $this */ public function setDebugFile($debugFile) { @@ -617,7 +622,7 @@ class Configuration * * @param string $tempFolderPath Temp folder path * - * @return Configuration + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -640,7 +645,7 @@ class Configuration * * @param boolean $sslVerification True if the certificate should be validated, false otherwise * - * @return Configuration + * @return $this */ public function setSSLVerification($sslVerification) { @@ -693,7 +698,7 @@ class Configuration { $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; From bfb4390a1c92af52fca232c17663d39dfb46f85c Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 9 Mar 2017 22:27:29 +0800 Subject: [PATCH 099/132] [TypeScript][Angular2] better code indentation, update Petstore sample (#4990) * fix query parameter indentation, update ts angular2 sample * update ts angular2 sample --- .../typescript-angular2/api.mustache | 22 +- .../typescript-angular2/default/.gitignore | 1 + .../typescript-angular2/default/api/PetApi.ts | 220 +++++++++--------- .../default/api/StoreApi.ts | 73 +++--- .../default/api/UserApi.ts | 128 +++++----- .../typescript-angular2/default/api/api.ts | 4 + .../default/configuration.ts | 2 +- .../default/model/Category.ts | 12 - .../default/model/Order.ts | 12 - .../typescript-angular2/default/model/Pet.ts | 12 - .../typescript-angular2/default/model/Tag.ts | 12 - .../typescript-angular2/default/model/User.ts | 12 - .../typescript-angular2/default/variables.ts | 8 +- .../typescript-angular2/npm/.gitignore | 1 + .../typescript-angular2/npm/README.md | 4 +- .../typescript-angular2/npm/api/UserApi.ts | 12 +- .../typescript-angular2/npm/package.json | 2 +- 17 files changed, 226 insertions(+), 311 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index c34b1c85dc1..2ac0497cacf 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -93,17 +93,17 @@ export class {{classname}} { {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - {{#isDateTime}} - queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); - {{/isDateTime}} - {{^isDateTime}} - {{#isDate}} - queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); - {{/isDate}} - {{^isDate}} - queryParameters.set('{{baseName}}', {{paramName}}); - {{/isDate}} - {{/isDateTime}} + {{#isDateTime}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDate}} + {{^isDate}} + queryParameters.set('{{baseName}}', {{paramName}}); + {{/isDate}} + {{/isDateTime}} } {{/isListContainer}} diff --git a/samples/client/petstore/typescript-angular2/default/.gitignore b/samples/client/petstore/typescript-angular2/default/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/default/.gitignore +++ b/samples/client/petstore/typescript-angular2/default/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index 502e8d2adda..26ee01017f7 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -196,8 +184,6 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -209,26 +195,30 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -248,7 +238,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - + headers.set('api_key', String(apiKey)); // to determine the Content-Type header let consumes: string[] = [ @@ -259,24 +249,27 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -290,11 +283,12 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - if (status !== undefined) { - queryParameters.set('status', status); + if (status) { + status.forEach((element) => { + queryParameters.append('status', element); + }) } - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -304,24 +298,27 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -335,11 +332,12 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - if (tags !== undefined) { - queryParameters.set('tags', tags); + if (tags) { + tags.forEach((element) => { + queryParameters.append('tags', element); + }) } - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -349,24 +347,27 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -385,8 +386,6 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -396,29 +395,32 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } + // authentication (api_key) required - if (this.configuration.apiKey) - { + if (this.configuration.apiKey) { headers.set('api_key', this.configuration.apiKey); } - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -432,8 +434,6 @@ export class PetApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -445,26 +445,30 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -487,8 +491,6 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - - // to determine the Content-Type header let consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -499,32 +501,38 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (name !== undefined) { - formParams.set('name', name); + formParams.set('name', name); } + if (status !== undefined) { - formParams.set('status', status); + formParams.set('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -547,8 +555,6 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } - - // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' @@ -559,32 +565,38 @@ export class PetApi { 'application/json', 'application/xml' ]; - + // authentication (petstore_auth) required // oauth required - if (this.configuration.accessToken) - { - headers.set('Authorization', 'Bearer ' + this.configuration.accessToken); + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams.set('additionalMetadata', additionalMetadata); } + if (file !== undefined) { - formParams.set('file', file); + formParams.set('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index e10a1281c22..b84d8f6a4f8 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -131,8 +119,6 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -142,18 +128,18 @@ export class StoreApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -166,8 +152,6 @@ export class StoreApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -177,23 +161,23 @@ export class StoreApi { 'application/json', 'application/xml' ]; - + // authentication (api_key) required - if (this.configuration.apiKey) - { + if (this.configuration.apiKey) { headers.set('api_key', this.configuration.apiKey); } - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -212,8 +196,6 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -223,18 +205,18 @@ export class StoreApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -248,8 +230,6 @@ export class StoreApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -259,20 +239,21 @@ export class StoreApi { 'application/json', 'application/xml' ]; - - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index 96868788a9c..50db16eee43 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import { Inject, Injectable, Optional } from '@angular/core'; @@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -192,8 +180,6 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -203,20 +189,21 @@ export class UserApi { 'application/json', 'application/xml' ]; - - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -230,8 +217,6 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -241,20 +226,21 @@ export class UserApi { 'application/json', 'application/xml' ]; - - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -268,8 +254,6 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -279,20 +263,21 @@ export class UserApi { 'application/json', 'application/xml' ]; - - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -311,8 +296,6 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -322,18 +305,18 @@ export class UserApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -352,8 +335,6 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -363,18 +344,18 @@ export class UserApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -390,12 +371,12 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (username !== undefined) { - queryParameters.set('username', username); - } - if (password !== undefined) { - queryParameters.set('password', password); + queryParameters.set('username', username); } + if (password !== undefined) { + queryParameters.set('password', password); + } // to determine the Content-Type header let consumes: string[] = [ @@ -406,18 +387,18 @@ export class UserApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -430,8 +411,6 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -441,18 +420,18 @@ export class UserApi { 'application/json', 'application/xml' ]; - - - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } @@ -472,8 +451,6 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - - // to determine the Content-Type header let consumes: string[] = [ ]; @@ -483,20 +460,21 @@ export class UserApi { 'application/json', 'application/xml' ]; - - headers.set('Content-Type', 'application/json'); - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, - responseType: ResponseContentType.Json + search: queryParameters }); + // https://github.com/swagger-api/swagger-codegen/issues/4037 + if (extraHttpRequestParams) { + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); + } + return this.http.request(path, requestOptions); } diff --git a/samples/client/petstore/typescript-angular2/default/api/api.ts b/samples/client/petstore/typescript-angular2/default/api/api.ts index 056206bfaca..0d1e9f047fd 100644 --- a/samples/client/petstore/typescript-angular2/default/api/api.ts +++ b/samples/client/petstore/typescript-angular2/default/api/api.ts @@ -1,3 +1,7 @@ export * from './PetApi'; +import { PetApi } from './PetApi'; export * from './StoreApi'; +import { StoreApi } from './StoreApi'; export * from './UserApi'; +import { UserApi } from './UserApi'; +export const APIS = [ PetApi, StoreApi, UserApi, ]; diff --git a/samples/client/petstore/typescript-angular2/default/configuration.ts b/samples/client/petstore/typescript-angular2/default/configuration.ts index 94989933b63..a566a180e4e 100644 --- a/samples/client/petstore/typescript-angular2/default/configuration.ts +++ b/samples/client/petstore/typescript-angular2/default/configuration.ts @@ -2,5 +2,5 @@ export class Configuration { apiKey: string; username: string; password: string; - accessToken: string; + accessToken: string | (() => string); } \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular2/default/model/Category.ts b/samples/client/petstore/typescript-angular2/default/model/Category.ts index 4ab562b6d3b..ffdacd4f707 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Category.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Category.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Order.ts b/samples/client/petstore/typescript-angular2/default/model/Order.ts index 8fdad0357f4..9c47071c5b6 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Order.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Order.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Pet.ts b/samples/client/petstore/typescript-angular2/default/model/Pet.ts index 14b0c4ced46..d64dc809e53 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Pet.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Pet.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/Tag.ts b/samples/client/petstore/typescript-angular2/default/model/Tag.ts index 2e1bf1572e1..8a3b99ae9ca 100644 --- a/samples/client/petstore/typescript-angular2/default/model/Tag.ts +++ b/samples/client/petstore/typescript-angular2/default/model/Tag.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/model/User.ts b/samples/client/petstore/typescript-angular2/default/model/User.ts index efb2351b234..43d00f7b318 100644 --- a/samples/client/petstore/typescript-angular2/default/model/User.ts +++ b/samples/client/petstore/typescript-angular2/default/model/User.ts @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ import * as models from './models'; diff --git a/samples/client/petstore/typescript-angular2/default/variables.ts b/samples/client/petstore/typescript-angular2/default/variables.ts index 27b987e9b23..944e688f1b1 100644 --- a/samples/client/petstore/typescript-angular2/default/variables.ts +++ b/samples/client/petstore/typescript-angular2/default/variables.ts @@ -1,3 +1,9 @@ import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new OpaqueToken('basePath'); \ No newline at end of file +export const BASE_PATH = new OpaqueToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular2/npm/.gitignore b/samples/client/petstore/typescript-angular2/npm/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/npm/.gitignore +++ b/samples/client/petstore/typescript-angular2/npm/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index bf59448d8e8..67e7d791cab 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703092202 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703092202 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index 3db8a332039..50db16eee43 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -371,19 +371,11 @@ export class UserApi { let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (username !== undefined) { - if(username instanceof Date) { - queryParameters.set('username', username.d.toISOString()); - } else { - queryParameters.set('username', username); - } + queryParameters.set('username', username); } if (password !== undefined) { - if(password instanceof Date) { - queryParameters.set('password', password.d.toISOString()); - } else { - queryParameters.set('password', password); - } + queryParameters.set('password', password); } // to determine the Content-Type header diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index e1c5d927281..583105f7727 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201702090204", + "version": "0.0.1-SNAPSHOT.201703092202", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [ From fb7599652794f7127b4f5dfaba4439d1933d3c7f Mon Sep 17 00:00:00 2001 From: pablograna Date: Thu, 9 Mar 2017 12:11:44 -0300 Subject: [PATCH 100/132] Make java spring controller constructor public. (#4972) * Make java spring controller constructor public. This lets users manually create the controller and inject the delegate in the spring configuration file, instead of letting spring scan for controllers and autowire the delegate. * Ran spring-all-pestore.sh. --- .../JavaSpring/apiController.mustache | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../src/main/java/io/swagger/api/FakeApi.java | 27 ++++--------------- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../java/io/swagger/model/FormatTest.java | 26 +++++------------- .../src/main/java/io/swagger/api/FakeApi.java | 27 ++++--------------- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../java/io/swagger/model/FormatTest.java | 26 +++++------------- .../src/main/java/io/swagger/api/FakeApi.java | 27 ++++--------------- .../io/swagger/api/FakeApiController.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../java/io/swagger/api/PetApiController.java | 2 +- .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../io/swagger/api/UserApiController.java | 2 +- .../java/io/swagger/model/FormatTest.java | 26 +++++------------- .../src/main/java/io/swagger/api/FakeApi.java | 27 ++++--------------- .../io/swagger/api/FakeApiController.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../java/io/swagger/api/PetApiController.java | 2 +- .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- .../io/swagger/api/UserApiController.java | 2 +- .../java/io/swagger/model/FormatTest.java | 26 +++++------------- .../src/main/java/io/swagger/api/FakeApi.java | 27 ++++--------------- .../src/main/java/io/swagger/api/PetApi.java | 19 +++++++------ .../main/java/io/swagger/api/StoreApi.java | 4 +++ .../src/main/java/io/swagger/api/UserApi.java | 14 +++++++--- 39 files changed, 237 insertions(+), 279 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache index d4ab09b71fe..608c22d212a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache @@ -33,7 +33,7 @@ public class {{classname}}Controller implements {{classname}} { private final {{classname}}Delegate delegate; @org.springframework.beans.factory.annotation.Autowired - {{classname}}Controller({{classname}}Delegate delegate) { + public {{classname}}Controller({{classname}}Delegate delegate) { this.delegate = delegate; }{{/isDelegate}} diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 6a3e9b8eeb3..3c622693dc5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -44,12 +45,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -61,6 +62,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", consumes = "application/json", @@ -77,6 +79,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", consumes = "application/json", @@ -91,6 +94,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", @@ -108,6 +112,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -123,13 +128,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -140,12 +144,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); + com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java index 49e70ead367..316ca6982bf 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -36,6 +37,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", consumes = "application/json", @@ -48,6 +50,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -59,6 +62,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = "application/json", consumes = "application/json", diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index 4fa2b81aa6a..7e715510dc4 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = "application/json", consumes = "application/json", @@ -33,6 +34,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = "application/json", consumes = "application/json", @@ -43,6 +45,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = "application/json", consumes = "application/json", @@ -54,6 +57,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -66,6 +70,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -77,17 +82,18 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + com.netflix.hystrix.HystrixCommand> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = "application/json", consumes = "application/json", @@ -99,11 +105,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 2b6bb97460c..1b8b27b8d15 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -44,12 +45,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -61,6 +62,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", consumes = "application/json", @@ -77,6 +79,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", consumes = "application/json", @@ -91,6 +94,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", @@ -108,6 +112,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -123,13 +128,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -140,12 +144,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index de152b505c0..4adbf7e7fc0 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -36,6 +37,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", consumes = "application/json", @@ -48,6 +50,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -59,6 +62,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = "application/json", consumes = "application/json", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index 28c184dabd1..b34e9bb0f77 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = "application/json", consumes = "application/json", @@ -33,6 +34,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = "application/json", consumes = "application/json", @@ -43,6 +45,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = "application/json", consumes = "application/json", @@ -54,6 +57,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -66,6 +70,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -77,17 +82,18 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = "application/json", consumes = "application/json", @@ -99,11 +105,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index b0bb957c8f2..133c9906b51 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -27,6 +27,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -43,24 +44,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { + default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -70,18 +59,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { + default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index fd5b2c93f82..f3cef991920 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -31,6 +31,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -49,11 +50,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -68,6 +69,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -86,6 +88,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -102,6 +105,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -121,6 +125,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -139,13 +144,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -159,13 +163,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index b99481c2aff..12bc5b40659 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -26,6 +26,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -40,6 +41,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -54,6 +56,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -67,6 +70,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 2b539a21966..f1fd5b05460 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -25,6 +25,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -37,6 +38,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -49,6 +51,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -62,6 +65,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -76,6 +80,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -89,11 +94,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default CompletableFuture> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -102,6 +107,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -115,11 +121,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java index fc491c68d6b..c6d568be7ed 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index 26e37db340a..ae092a55402 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java index aed8db1ed96..ad8680a3beb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index f6611a91a30..40d9281a51a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -26,6 +26,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -42,24 +43,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -69,18 +58,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { + default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java index 4ed0677b103..9f5e48caec9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java @@ -26,7 +26,7 @@ public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - FakeApiController(FakeApiDelegate delegate) { + public FakeApiController(FakeApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index 7ffb559205b..c387ea95877 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -30,6 +30,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -48,11 +49,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -67,6 +68,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -85,6 +87,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -101,6 +104,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -120,6 +124,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -138,13 +143,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -158,13 +162,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java index 03c23df7b47..c4099e569b4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java @@ -25,7 +25,7 @@ public class PetApiController implements PetApi { private final PetApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - PetApiController(PetApiDelegate delegate) { + public PetApiController(PetApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index 2c1ad770b52..227c85b9e55 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -25,6 +25,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -39,6 +40,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -53,6 +55,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -66,6 +69,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java index 050a9d7de74..07ed22b7314 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - StoreApiController(StoreApiDelegate delegate) { + public StoreApiController(StoreApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index 384f944c78f..b01d889484a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -24,6 +24,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -36,6 +37,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -48,6 +50,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -61,6 +64,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -75,6 +79,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,11 +93,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -101,6 +106,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -114,11 +120,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java index 785e28f4509..d1da3d48881 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java @@ -24,7 +24,7 @@ public class UserApiController implements UserApi { private final UserApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - UserApiController(UserApiDelegate delegate) { + public UserApiController(UserApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java index fc491c68d6b..c6d568be7ed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index 26e37db340a..ae092a55402 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java index 5d9ae688c43..21f28bc17f1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java @@ -26,7 +26,7 @@ public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - FakeApiController(FakeApiDelegate delegate) { + public FakeApiController(FakeApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java index 03c23df7b47..c4099e569b4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java @@ -25,7 +25,7 @@ public class PetApiController implements PetApi { private final PetApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - PetApiController(PetApiDelegate delegate) { + public PetApiController(PetApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java index 050a9d7de74..07ed22b7314 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - StoreApiController(StoreApiDelegate delegate) { + public StoreApiController(StoreApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java index 785e28f4509..d1da3d48881 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java @@ -24,7 +24,7 @@ public class UserApiController implements UserApi { private final UserApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - UserApiController(UserApiDelegate delegate) { + public UserApiController(UserApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java index aed8db1ed96..ad8680a3beb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index 26e37db340a..ae092a55402 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } From bfa8d350b30ab4d3fefa5d76e3dd97cc3729df5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20D=C3=B6bler?= Date: Thu, 9 Mar 2017 16:18:11 +0100 Subject: [PATCH 101/132] JS files were replaced in the lib folder; include new (#4985) Fix https://github.com/swagger-api/swagger-codegen/issues/4983 --- modules/swagger-generator/src/main/webapp/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-generator/src/main/webapp/index.html b/modules/swagger-generator/src/main/webapp/index.html index b3c14aacd05..694a55049b9 100644 --- a/modules/swagger-generator/src/main/webapp/index.html +++ b/modules/swagger-generator/src/main/webapp/index.html @@ -13,12 +13,12 @@ - + - + From dc8d04eb1ceaaf6cdd1b05fa8c3d30f8efd7a92c Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 9 Mar 2017 23:41:31 -0800 Subject: [PATCH 102/132] updated parser --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72aeb6df506..bb9a65a286d 100644 --- a/pom.xml +++ b/pom.xml @@ -863,7 +863,7 @@ - 1.0.26 + 1.0.27-SNAPSHOT 2.11.1 2.3.4 1.5.12 From ec3b3389883019b1e9e1afe055314c62d6598092 Mon Sep 17 00:00:00 2001 From: David Biesack Date: Fri, 10 Mar 2017 08:47:20 -0500 Subject: [PATCH 103/132] Improve HTML output for model titles, default responses (#4991) Render "default" instead of 0 for response code when Swagger uses "default" (#4982) Add title for models to TOC and each model's section Render model description only conditionally. Remove extraneous Up link Regenerate samples/html/index.html --- .../languages/StaticHtmlGenerator.java | 10 +- .../main/resources/htmlDocs/index.mustache | 7 +- samples/html/index.html | 187 +++++++++--------- 3 files changed, 104 insertions(+), 100 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java index 2fe4cd7b665..1a69811723e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java @@ -4,6 +4,7 @@ import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenResponse; import io.swagger.codegen.CodegenType; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; @@ -41,7 +42,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC)); - + additionalProperties.put("appName", "Swagger Sample"); additionalProperties.put("appDescription", "A sample swagger server"); additionalProperties.put("infoUrl", "https://helloreverb.com"); @@ -96,12 +97,17 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig return super.getTypeDeclaration(p); } - @Override +@Override public Map postProcessOperations(Map objs) { Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { op.httpMethod = op.httpMethod.toLowerCase(); + for (CodegenResponse response : op.responses) { + if ("0".equals(response.code)) { + response.code = "default"; + } + } } return objs; } diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache index 6d5dfaccb2d..c723c483d32 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache @@ -148,7 +148,6 @@ {{/apis}} {{/apiInfo}} -

Models

[ Jump to Methods ] @@ -156,7 +155,7 @@
    {{#models}} {{#model}} -
  1. {{name}}
  2. +
  3. {{name}}{{#title}} - {{title}}{{/title}}
  4. {{/model}} {{/models}}
@@ -164,8 +163,8 @@ {{#models}} {{#model}}
-

{{name}} - {{title}} Up

-
{{unescapedDescription}}
+

{{name}}{{#title}} - {{title}}{{/title}} Up

+ {{#unescapedDescription}}
{{unescapedDescription}}
{{/unescapedDescription}}
{{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{datatype}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{#isEnum}} diff --git a/samples/html/index.html b/samples/html/index.html index 60e62451c1c..57726e2ecf8 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -344,30 +344,30 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
+  123456789
   doggie
   
-    string
+    aeiou
   
   
   
-  string
+  aeiou
 

Example data

Content-Type: application/json
[ {
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 7,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 2,
+  "category" : {
+    "id" : 2,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 } ]

Produces

@@ -417,30 +417,30 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
+  123456789
   doggie
   
-    string
+    aeiou
   
   
   
-  string
+  aeiou
 

Example data

Content-Type: application/json
[ {
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 1,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 9,
+  "category" : {
+    "id" : 4,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 } ]

Produces

@@ -490,30 +490,30 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
+  123456789
   doggie
   
-    string
+    aeiou
   
   
   
-  string
+  aeiou
 

Example data

Content-Type: application/json
{
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 5,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 8,
+  "category" : {
+    "id" : 3,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 }

Produces

@@ -679,9 +679,9 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "code" : 123,
-  "type" : "aeiou",
-  "message" : "aeiou"
+  "message" : "aeiou",
+  "code" : 3,
+  "type" : "aeiou"
 }

Produces

@@ -762,7 +762,7 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "key" : 123
+  "key" : 9
 }

Produces

@@ -808,22 +808,22 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
-  123456
-  0
+  123456789
+  123456789
+  123
   2000-01-23T04:56:07.000Z
-  string
+  aeiou
   true
 

Example data

Content-Type: application/json
{
-  "petId" : 123456789,
-  "quantity" : 123,
-  "id" : 123456789,
-  "shipDate" : "2000-01-23T04:56:07.000+00:00",
-  "complete" : true,
-  "status" : "aeiou"
+  "id" : 5,
+  "petId" : 8,
+  "complete" : false,
+  "status" : "placed",
+  "quantity" : 4,
+  "shipDate" : "2000-01-23T04:56:07.000+00:00"
 }

Produces

@@ -877,22 +877,22 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
-  123456
-  0
+  123456789
+  123456789
+  123
   2000-01-23T04:56:07.000Z
-  string
+  aeiou
   true
 

Example data

Content-Type: application/json
{
-  "petId" : 123456789,
-  "quantity" : 123,
-  "id" : 123456789,
-  "shipDate" : "2000-01-23T04:56:07.000+00:00",
-  "complete" : true,
-  "status" : "aeiou"
+  "id" : 6,
+  "petId" : 9,
+  "complete" : false,
+  "status" : "placed",
+  "quantity" : 2,
+  "shipDate" : "2000-01-23T04:56:07.000+00:00"
 }

Produces

@@ -946,7 +946,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation
@@ -984,7 +984,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation
@@ -1022,7 +1022,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -1097,26 +1097,26 @@ font-style: italic;

Example data

Content-Type: application/xml

-  123456
-  string
-  string
-  string
-  string
-  string
-  string
-  0
+  123456789
+  aeiou
+  aeiou
+  aeiou
+  aeiou
+  aeiou
+  aeiou
+  123
 

Example data

Content-Type: application/json
{
-  "firstName" : "aeiou",
+  "id" : 4,
   "lastName" : "aeiou",
-  "password" : "aeiou",
-  "userStatus" : 123,
   "phone" : "aeiou",
-  "id" : 123456789,
+  "username" : "aeiou",
   "email" : "aeiou",
-  "username" : "aeiou"
+  "userStatus" : 1,
+  "firstName" : "aeiou",
+  "password" : "aeiou"
 }

Produces

@@ -1170,7 +1170,7 @@ font-style: italic;

Example data

Content-Type: application/xml
-
string
+
aeiou

Example data

Content-Type: application/json
"aeiou"
@@ -1218,7 +1218,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -1271,22 +1271,21 @@ font-style: italic;
-

Models

[ Jump to Methods ]

Table of Contents

    -
  1. ApiResponse
  2. -
  3. Category
  4. -
  5. Order
  6. -
  7. Pet
  8. -
  9. Tag
  10. -
  11. User
  12. +
  13. ApiResponse - An uploaded response
  14. +
  15. Category - Pet catehgry
  16. +
  17. Order - Pet Order
  18. +
  19. Pet - a Pet
  20. +
  21. Tag - Pet Tag
  22. +
  23. User - a User
-

ApiResponse - An uploaded response Up

+

ApiResponse - An uploaded response Up

Describes the result of uploading an image resource
code (optional)
Integer format: int32
@@ -1295,7 +1294,7 @@ font-style: italic;
-

Category - Pet catehgry Up

+

Category - Pet catehgry Up

A category for a pet
id (optional)
Long format: int64
@@ -1303,7 +1302,7 @@ font-style: italic;
-

Order - Pet Order Up

+

Order - Pet Order Up

An order for a pets from the pet store
id (optional)
Long format: int64
@@ -1317,7 +1316,7 @@ font-style: italic;
-

Pet - a Pet Up

+

Pet - a Pet Up

A pet for sale in the pet store
id (optional)
Long format: int64
@@ -1331,7 +1330,7 @@ font-style: italic;
-

Tag - Pet Tag Up

+

Tag - Pet Tag Up

A tag for a pet
id (optional)
Long format: int64
@@ -1339,7 +1338,7 @@ font-style: italic;
-

User - a User Up

+

User - a User Up

A User who is purchasing from the pet store
id (optional)
Long format: int64
From 20c8f9a8316fffed3744b36143d1b3c9aaf26d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Fri, 10 Mar 2017 09:10:49 -0500 Subject: [PATCH 104/132] Java Play Framework Server Generator (#4943) * First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework. * Fix suggestions in the PR discussion + add .bat and .sh file as requested. * Updated Readme.md file * Remove unused mustache file + fix baseName vs paramName in all the mustache files. * Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself. * Fix the problem with the Http.MultipartFormData.FilePart --- README.md | 3 + bin/java-play-framework-petstore-server.sh | 31 ++ .../java-play-framework-petstore-server.bat | 10 + .../io/swagger/codegen/CodegenParameter.java | 4 + .../languages/JavaPlayFrameworkCodegen.java | 248 ++++++++++++ .../JavaPlayFramework/LICENSE.mustache | 8 + .../JavaPlayFramework/README.mustache | 4 + .../apiDocController.mustache | 15 + .../JavaPlayFramework/application.mustache | 361 ++++++++++++++++++ .../JavaPlayFramework/beanValidation.mustache | 53 +++ .../beanValidationPathParams.mustache | 1 + .../beanValidationQueryParams.mustache | 1 + .../bodyParamsNoDoc.mustache | 1 + .../JavaPlayFramework/build.mustache | 17 + .../buildproperties.mustache | 1 + .../conversionBegin.mustache | 1 + .../JavaPlayFramework/conversionEnd.mustache | 1 + .../JavaPlayFramework/enumClass.mustache | 44 +++ .../JavaPlayFramework/enumOuterClass.mustache | 42 ++ .../formParamsNoDoc.mustache | 1 + .../generatedAnnotation.mustache | 3 + .../headerParamsNoDoc.mustache | 1 + .../JavaPlayFramework/logback.mustache | 41 ++ .../JavaPlayFramework/model.mustache | 22 ++ .../JavaPlayFramework/newApi.mustache | 24 ++ .../newApiController.mustache | 162 ++++++++ .../notFoundException.mustache | 10 + .../paramDefaultValue.mustache | 1 + .../JavaPlayFramework/paramType.mustache | 1 + .../JavaPlayFramework/pathParams.mustache | 1 + .../pathParamsNoDoc.mustache | 1 + .../JavaPlayFramework/plugins.mustache | 2 + .../resources/JavaPlayFramework/pojo.mustache | 118 ++++++ .../project/build.properties | 1 + .../JavaPlayFramework/project/plugins.sbt | 9 + .../queryParamsNoDoc.mustache | 1 + .../JavaPlayFramework/returnTypes.mustache | 1 + .../returnTypesNoVoid.mustache | 1 + .../returnTypesNoVoidNoAbstract.mustache | 1 + .../JavaPlayFramework/routes.mustache | 27 ++ .../JavaPlayFramework/swaggerUtils.mustache | 108 ++++++ .../typeInfoAnnotation.mustache | 7 + .../services/io.swagger.codegen.CodegenConfig | 1 + .../JavaPlayFrameworkOptionsTest.java | 68 ++++ .../JavaPlayFrameworkOptionsProvider.java | 42 ++ 45 files changed, 1501 insertions(+) create mode 100644 bin/java-play-framework-petstore-server.sh create mode 100644 bin/windows/java-play-framework-petstore-server.bat create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java diff --git a/README.md b/README.md index 7aad69a2981..8e99b9cd7b2 100644 --- a/README.md +++ b/README.md @@ -909,6 +909,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [SRC](https://www.src.si/) +- [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [TaskData](http://www.taskdata.com/) @@ -961,6 +962,7 @@ Swagger Codegen core team members are contributors who have been making signific | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | +| Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsum (2016/05/01) | @@ -1008,6 +1010,7 @@ Here is a list of template creators: * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu + * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard diff --git a/bin/java-play-framework-petstore-server.sh b/bin/java-play-framework-petstore-server.sh new file mode 100644 index 00000000000..ff8103e2204 --- /dev/null +++ b/bin/java-play-framework-petstore-server.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaPlayFramework -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java-play-framework -o samples/server/petstore/java-play-framework -DhideGenerationTimestamp=true" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/java-play-framework-petstore-server.bat b/bin/windows/java-play-framework-petstore-server.bat new file mode 100644 index 00000000000..b2d2604f59c --- /dev/null +++ b/bin/windows/java-play-framework-petstore-server.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l java-play-framework -o samples\server\petstore\java-play-framework + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index e30159f9553..db0464ba7bd 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -11,6 +11,10 @@ public class CodegenParameter { secondaryParam, isCollectionFormatMulti, isPrimitiveType; public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName; + + //This was added for javaPlayFramework specifically to get around a bug in swagger-play. See generator for more info on the bug. + public String dataTypeForImplicitParam; + public String example; // example value (x-example) public String jsonSchema; public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java new file mode 100644 index 00000000000..ef87ed93b05 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java @@ -0,0 +1,248 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.*; +import io.swagger.codegen.languages.features.BeanValidationFeatures; + +import java.io.File; +import java.util.List; +import java.util.Map; + +public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { + + public static final String TITLE = "title"; + public static final String CONFIG_PACKAGE = "configPackage"; + public static final String BASE_PACKAGE = "basePackage"; + public static final String CONTROLLER_ONLY = "controllerOnly"; + public static final String SINGLE_CONTENT_TYPES = "singleContentTypes"; + public static final String RESPONSE_WRAPPER = "responseWrapper"; + public static final String USE_TAGS = "useTags"; + + protected String title = "swagger-petstore"; + protected String configPackage = "io.swagger.configuration"; + protected String basePackage = "io.swagger"; + protected boolean controllerOnly = false; + protected boolean singleContentTypes = false; + protected String responseWrapper = ""; + protected boolean useTags = false; + protected boolean useBeanValidation = true; + + public JavaPlayFrameworkCodegen() { + super(); + outputFolder = "generated-code/javaPlayFramework"; + apiTestTemplateFiles.clear(); + embeddedTemplateDir = templateDir = "JavaPlayFramework"; + apiPackage = "controllers"; + modelPackage = "apimodels"; + invokerPackage = "io.swagger.api"; + artifactId = "swagger-java-playframework"; + + projectFolder = ""; + sourceFolder = projectFolder + File.separator + "app"; + projectTestFolder = projectFolder + File.separator + "test"; + testFolder = projectTestFolder; + + additionalProperties.put(CONFIG_PACKAGE, configPackage); + additionalProperties.put(BASE_PACKAGE, basePackage); + + additionalProperties.put("jackson", "true"); + + cliOptions.add(new CliOption(TITLE, "server title name or client service name")); + cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code")); + cliOptions.add(new CliOption(BASE_PACKAGE, "base package for generated code")); + cliOptions.add(CliOption.newBoolean(CONTROLLER_ONLY, "Whether to generate only API interface stubs without the server files.")); + cliOptions.add(CliOption.newBoolean(SINGLE_CONTENT_TYPES, "Whether to select only one produces/consumes content-type by operation.")); + cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)")); + cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + } + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public String getName() { + return "java-play-framework"; + } + + @Override + public String getHelp() { + return "Generates a Java Play Framework Server application."; + } + + @Override + public void processOpts() { + super.processOpts(); + + // clear model and api doc template as this codegen + // does not support auto-generated markdown doc at the moment + //TODO: add doc templates + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + if (additionalProperties.containsKey(TITLE)) { + this.setTitle((String) additionalProperties.get(TITLE)); + } + + if (additionalProperties.containsKey(CONFIG_PACKAGE)) { + this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE)); + } + + if (additionalProperties.containsKey(BASE_PACKAGE)) { + this.setBasePackage((String) additionalProperties.get(BASE_PACKAGE)); + } + + if (additionalProperties.containsKey(CONTROLLER_ONLY)) { + this.setControllerOnly(Boolean.valueOf(additionalProperties.get(CONTROLLER_ONLY).toString())); + } + + if (additionalProperties.containsKey(SINGLE_CONTENT_TYPES)) { + this.setSingleContentTypes(Boolean.valueOf(additionalProperties.get(SINGLE_CONTENT_TYPES).toString())); + } + + if (additionalProperties.containsKey(RESPONSE_WRAPPER)) { + this.setResponseWrapper((String) additionalProperties.get(RESPONSE_WRAPPER)); + } + + if (additionalProperties.containsKey(USE_TAGS)) { + this.setUseTags(Boolean.valueOf(additionalProperties.get(USE_TAGS).toString())); + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + + //Root folder + supportingFiles.add(new SupportingFile("README.mustache", "", "README")); + supportingFiles.add(new SupportingFile("LICENSE.mustache", "", "LICENSE")); + supportingFiles.add(new SupportingFile("build.mustache", "", "build.sbt")); + + //Project folder + supportingFiles.add(new SupportingFile("buildproperties.mustache", "project", "build.properties")); + supportingFiles.add(new SupportingFile("plugins.mustache", "project", "plugins.sbt")); + + //Conf folder + supportingFiles.add(new SupportingFile("logback.mustache", "conf", "logback.xml")); + supportingFiles.add(new SupportingFile("application.mustache", "conf", "application.conf")); + supportingFiles.add(new SupportingFile("routes.mustache", "conf", "routes")); + + //App/Utils folder + supportingFiles.add(new SupportingFile("swaggerUtils.mustache", "app/swagger", "SwaggerUtils.java")); + + //App/Controllers + supportingFiles.add(new SupportingFile("apiDocController.mustache", "app/controllers", "ApiDocController.java")); + + //We remove the default api.mustache that is used + apiTemplateFiles.remove("api.mustache"); + apiTemplateFiles.put("newApiController.mustache", "Controller.java"); + if (!this.controllerOnly) { + apiTemplateFiles.put("newApi.mustache", "ControllerImp.java"); + } + + additionalProperties.put("javaVersion", "1.8"); + additionalProperties.put("jdk8", "true"); + typeMapping.put("date", "LocalDate"); + typeMapping.put("DateTime", "OffsetDateTime"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); + + // Some well-known Spring or Spring-Cloud response wrappers + switch (this.responseWrapper) { + case "Future": + case "Callable": + case "CompletableFuture": + additionalProperties.put(RESPONSE_WRAPPER, "java.util.concurrent" + this.responseWrapper); + break; + default: + break; + } + } + + public void setTitle(String title) { + this.title = title; + } + + public void setConfigPackage(String configPackage) { + this.configPackage = configPackage; + } + + public void setBasePackage(String configPackage) { + this.basePackage = configPackage; + } + + public void setControllerOnly(boolean controllerOnly) { this.controllerOnly = controllerOnly; } + + public void setSingleContentTypes(boolean singleContentTypes) { + this.singleContentTypes = singleContentTypes; + } + + public void setResponseWrapper(String responseWrapper) { this.responseWrapper = responseWrapper; } + + public void setUseTags(boolean useTags) { + this.useTags = useTags; + } + + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + + //This is to fix this bug in the swagger-play project: https://github.com/swagger-api/swagger-play/issues/131 + //We need to explicitly add the model package name in front of the dataType because if we don't, the + //implicitParam is not valid and show error when loading the documentation + //This can be removed safely after the bug has been fixed + for (CodegenParameter param : operation.allParams) { + if (!param.isPathParam ) { + if (!param.isPrimitiveType && !param.isListContainer && !param.isMapContainer) { + param.dataTypeForImplicitParam = String.format("%s.%s", modelPackage, param.dataType); + } else { + param.dataTypeForImplicitParam = param.dataType; + } + } + } + + if (operation.path.contains("{")) { + operation.path = operation.path.replace("{", ":").replace("}", ""); + } + + if (operation.returnType != null) { + if (operation.returnType.startsWith("List")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("List<".length(), end).trim(); + operation.returnContainer = "List"; + } + } else if (operation.returnType.startsWith("Map")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); + operation.returnContainer = "Map"; + } + } else if (operation.returnType.startsWith("Set")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Set<".length(), end).trim(); + operation.returnContainer = "Set"; + } + } + } + } + } + + return objs; + } + + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache new file mode 100644 index 00000000000..4baedcb95f3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache @@ -0,0 +1,8 @@ +This software is licensed under the Apache 2 license, quoted below. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with +the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache new file mode 100644 index 00000000000..2fce02950d2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache @@ -0,0 +1,4 @@ +This is your new Play application +================================= + +This file will be packaged with your application when using `activator dist`. \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache new file mode 100644 index 00000000000..60534355ae3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache @@ -0,0 +1,15 @@ +package controllers; + +import javax.inject.*; +import play.mvc.*; + +public class ApiDocController extends Controller { + + @Inject + private ApiDocController() { + } + + public Result api() { + return redirect(String.format("/assets/lib/swagger-ui/index.html?/url=%s/api-docs", "")); + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache new file mode 100644 index 00000000000..d6d9e9fa92b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache @@ -0,0 +1,361 @@ +springfox.documentation.swagger.v2.path=/api-docs +server.contextPath={{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}} +server.port={{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}9000{{/serverPort}} +spring.jackson.date-format={{basePackage}}.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false + +# This is the main configuration file for the application. +# https://www.playframework.com/documentation/latest/ConfigFile +# ~~~~~ +# Play uses HOCON as its configuration file format. HOCON has a number +# of advantages over other config formats, but there are two things that +# can be used when modifying settings. +# +# You can include other configuration files in this main application.conf file: +#include "extra-config.conf" +# +# You can declare variables and substitute for them: +#mykey = ${some.value} +# +# And if an environment variable exists when there is no other subsitution, then +# HOCON will fall back to substituting environment variable: +#mykey = ${JAVA_HOME} + +## Akka +# https://www.playframework.com/documentation/latest/ScalaAkka#Configuration +# https://www.playframework.com/documentation/latest/JavaAkka#Configuration +# ~~~~~ +# Play uses Akka internally and exposes Akka Streams and actors in Websockets and +# other streaming HTTP responses. +akka { +# "akka.log-config-on-start" is extraordinarly useful because it log the complete +# configuration at INFO level, including defaults and overrides, so it s worth +# putting at the very top. +# +# Put the following in your conf/logback.xml file: +# +# +# +# And then uncomment this line to debug the configuration. +# +#log-config-on-start = true +} + +api.version="1.0" + +## Secret key +# http://www.playframework.com/documentation/latest/ApplicationSecret +# ~~~~~ +# The secret key is used to sign Play's session cookie. +# This must be changed for production, but we don't recommend you change it in this file. +play.crypto.secret = "changeme" + +## Modules +# https://www.playframework.com/documentation/latest/Modules +# ~~~~~ +# Control which modules are loaded when Play starts. Note that modules are +# the replacement for "GlobalSettings", which are deprecated in 2.5.x. +# Please see https://www.playframework.com/documentation/latest/GlobalSettings +# for more information. +# +# You can also extend Play functionality by using one of the publically available +# Play modules: https://playframework.com/documentation/latest/ModuleDirectory +play.modules { +# By default, Play will load any class called Module that is defined +# in the root package (the "app" directory), or you can define them +# explicitly below. +# If there are any built-in modules that you want to disable, you can list them here. +enabled += "play.modules.swagger.SwaggerModule" + +# If there are any built-in modules that you want to disable, you can list them here. +#disabled += "" +} + +## IDE +# https://www.playframework.com/documentation/latest/IDE +# ~~~~~ +# Depending on your IDE, you can add a hyperlink for errors that will jump you +# directly to the code location in the IDE in dev mode. The following line makes +# use of the IntelliJ IDEA REST interface: +#play.editor="http://localhost:63342/api/file/?file=%s&line=%s" + +## Internationalisation +# https://www.playframework.com/documentation/latest/JavaI18N +# https://www.playframework.com/documentation/latest/ScalaI18N +# ~~~~~ +# Play comes with its own i18n settings, which allow the user's preferred language +# to map through to internal messages, or allow the language to be stored in a cookie. +play.i18n { +# The application languages +langs = [ "en" ] + +# Whether the language cookie should be secure or not +#langCookieSecure = true + +# Whether the HTTP only attribute of the cookie should be set to true +#langCookieHttpOnly = true +} + +## Play HTTP settings +# ~~~~~ +play.http { +## Router +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# Define the Router object to use for this application. +# This router will be looked up first when the application is starting up, +# so make sure this is the entry point. +# Furthermore, it's assumed your route file is named properly. +# So for an application router like `my.application.Router`, +# you may need to define a router file `conf/my.application.routes`. +# Default to Routes in the root package (aka "apps" folder) (and conf/routes) +#router = my.application.Router + +## Action Creator +# https://www.playframework.com/documentation/latest/JavaActionCreator +# ~~~~~ +#actionCreator = null + +## ErrorHandler +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# If null, will attempt to load a class called ErrorHandler in the root package, +#errorHandler = null + +## Filters +# https://www.playframework.com/documentation/latest/ScalaHttpFilters +# https://www.playframework.com/documentation/latest/JavaHttpFilters +# ~~~~~ +# Filters run code on every request. They can be used to perform +# common logic for all your actions, e.g. adding common headers. +# Defaults to "Filters" in the root package (aka "apps" folder) +# Alternatively you can explicitly register a class here. +#filters = my.application.Filters + +## Session & Flash +# https://www.playframework.com/documentation/latest/JavaSessionFlash +# https://www.playframework.com/documentation/latest/ScalaSessionFlash +# ~~~~~ +session { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true + +# Sets the max-age field of the cookie to 5 minutes. +# NOTE: this only sets when the browser will discard the cookie. Play will consider any +# cookie value with a valid signature to be a valid session forever. To implement a server side session timeout, +# you need to put a timestamp in the session and check it at regular intervals to possibly expire it. +#maxAge = 300 + +# Sets the domain on the session cookie. +#domain = "example.com" +} + +flash { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true +} +} + +## Netty Provider +# https://www.playframework.com/documentation/latest/SettingsNetty +# ~~~~~ +play.server.netty { +# Whether the Netty wire should be logged +#log.wire = true + +# If you run Play on Linux, you can use Netty's native socket transport +# for higher performance with less garbage. +#transport = "native" +} + +## WS (HTTP Client) +# https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS +# ~~~~~ +# The HTTP client primarily used for REST APIs. The default client can be +# configured directly, but you can also create different client instances +# with customized settings. You must enable this by adding to build.sbt: +# +# libraryDependencies += ws // or javaWs if using java +# +play.ws { +# Sets HTTP requests not to follow 302 requests +#followRedirects = false + +# Sets the maximum number of open HTTP connections for the client. +#ahc.maxConnectionsTotal = 50 + +## WS SSL +# https://www.playframework.com/documentation/latest/WsSSL +# ~~~~~ +ssl { +# Configuring HTTPS with Play WS does not require programming. You can +# set up both trustManager and keyManager for mutual authentication, and +# turn on JSSE debugging in development with a reload. +#debug.handshake = true +#trustManager = { +# stores = [ +# { type = "JKS", path = "exampletrust.jks" } +# ] +#} +} +} + +## Cache +# https://www.playframework.com/documentation/latest/JavaCache +# https://www.playframework.com/documentation/latest/ScalaCache +# ~~~~~ +# Play comes with an integrated cache API that can reduce the operational +# overhead of repeated requests. You must enable this by adding to build.sbt: +# +# libraryDependencies += cache +# +play.cache { +# If you want to bind several caches, you can bind the individually +#bindCaches = ["db-cache", "user-cache", "session-cache"] +} + +## Filters +# https://www.playframework.com/documentation/latest/Filters +# ~~~~~ +# There are a number of built-in filters that can be enabled and configured +# to give Play greater security. You must enable this by adding to build.sbt: +# +# libraryDependencies += filters +# +play.filters { +## CORS filter configuration +# https://www.playframework.com/documentation/latest/CorsFilter +# ~~~~~ +# CORS is a protocol that allows web applications to make requests from the browser +# across different domains. +# NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has +# dependencies on CORS settings. +cors { +# Filter paths by a whitelist of path prefixes +#pathPrefixes = ["/some/path", ...] + +# The allowed origins. If null, all origins are allowed. +#allowedOrigins = ["http://www.example.com"] + +# The allowed HTTP methods. If null, all methods are allowed +#allowedHttpMethods = ["GET", "POST"] +} + +## CSRF Filter +# https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter +# https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter +# ~~~~~ +# Play supports multiple methods for verifying that a request is not a CSRF request. +# The primary mechanism is a CSRF token. This token gets placed either in the query string +# or body of every form submitted, and also gets placed in the users session. +# Play then verifies that both tokens are present and match. +csrf { +# Sets the cookie to be sent only over HTTPS +#cookie.secure = true + +# Defaults to CSRFErrorHandler in the root package. +#errorHandler = MyCSRFErrorHandler +} + +## Security headers filter configuration +# https://www.playframework.com/documentation/latest/SecurityHeaders +# ~~~~~ +# Defines security headers that prevent XSS attacks. +# If enabled, then all options are set to the below configuration by default: +headers { +# The X-Frame-Options header. If null, the header is not set. +#frameOptions = "DENY" + +# The X-XSS-Protection header. If null, the header is not set. +#xssProtection = "1; mode=block" + +# The X-Content-Type-Options header. If null, the header is not set. +#contentTypeOptions = "nosniff" + +# The X-Permitted-Cross-Domain-Policies header. If null, the header is not set. +#permittedCrossDomainPolicies = "master-only" + +# The Content-Security-Policy header. If null, the header is not set. +#contentSecurityPolicy = "default-src 'self'" +} + +## Allowed hosts filter configuration +# https://www.playframework.com/documentation/latest/AllowedHostsFilter +# ~~~~~ +# Play provides a filter that lets you configure which hosts can access your application. +# This is useful to prevent cache poisoning attacks. +hosts { +# Allow requests to example.com, its subdomains, and localhost:9000. +#allowed = [".example.com", "localhost:9000"] +} +} + +## Evolutions +# https://www.playframework.com/documentation/latest/Evolutions +# ~~~~~ +# Evolutions allows database scripts to be automatically run on startup in dev mode +# for database migrations. You must enable this by adding to build.sbt: +# +# libraryDependencies += evolutions +# +play.evolutions { +# You can disable evolutions for a specific datasource if necessary +#db.default.enabled = false +} + +## Database Connection Pool +# https://www.playframework.com/documentation/latest/SettingsJDBC +# ~~~~~ +# Play doesn't require a JDBC database to run, but you can easily enable one. +# +# libraryDependencies += jdbc +# +play.db { +# The combination of these two settings results in "db.default" as the +# default JDBC pool: +#config = "db" +#default = "default" + +# Play uses HikariCP as the default connection pool. You can override +# settings by changing the prototype: +prototype { +# Sets a fixed JDBC connection pool size of 50 +#hikaricp.minimumIdle = 50 +#hikaricp.maximumPoolSize = 50 +} +} + +## JDBC Datasource +# https://www.playframework.com/documentation/latest/JavaDatabase +# https://www.playframework.com/documentation/latest/ScalaDatabase +# ~~~~~ +# Once JDBC datasource is set up, you can work with several different +# database options: +# +# Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick +# JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA +# EBean: https://playframework.com/documentation/latest/JavaEbean +# Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm +# +db { +# You can declare as many datasources as you want. +# By convention, the default datasource is named `default` + +# https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database +#default.driver = org.h2.Driver +#default.url = "jdbc:h2:mem:play" +#default.username = sa +#default.password = "" + +# You can turn on SQL logging for any datasource +# https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements +#default.logSql=true +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache new file mode 100644 index 00000000000..3c7ba4b08ea --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache @@ -0,0 +1,17 @@ +name := """{{artifactId}}""" + +version := "1.0-SNAPSHOT" + +lazy val root = (project in file(".")).enablePlugins(PlayJava) + +scalaVersion := "2.11.7" + +libraryDependencies ++= Seq( +javaJdbc, +cache, +javaWs, +"io.swagger" %% "swagger-play2" % "1.5.3", +"org.webjars" % "swagger-ui" % "2.2.8"{{#useBeanValidation}}, +"javax.validation" % "validation-api" % "1.1.0.Final" +{{/useBeanValidation}} +) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache new file mode 100644 index 00000000000..59e7c05b62f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache @@ -0,0 +1 @@ +sbt.version=0.13.11 \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache new file mode 100644 index 00000000000..21631412a2b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -0,0 +1 @@ +{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isString}}(String){{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache new file mode 100644 index 00000000000..2a36cdff8ab --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache @@ -0,0 +1 @@ +{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isString}}{{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache new file mode 100644 index 00000000000..c5c3143cb94 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -0,0 +1,44 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#gson}} + {{#allowableValues}} + {{#enumVars}} + @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/gson}} + {{^gson}} + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/gson}} + + private {{{datatype}}} value; + + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache new file mode 100644 index 00000000000..76c2cbf5a76 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -0,0 +1,42 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/jackson}} + +/** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ +public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#gson}} + {{#allowableValues}}{{#enumVars}} + @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + {{^gson}} + {{#allowableValues}}{{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + + private {{{dataType}}} value; + + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache new file mode 100644 index 00000000000..866a5e96df5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}Http.MultipartFormData.FilePart {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache new file mode 100644 index 00000000000..ad17a426e96 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache @@ -0,0 +1,3 @@ +{{^hideGenerationTimestamp}} +@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") +{{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache new file mode 100644 index 00000000000..bd03573d196 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache new file mode 100644 index 00000000000..01f301ab73a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache @@ -0,0 +1,41 @@ + + + + + + + ${application.home:-.}/logs/application.log + + %date [%level] from %logger in %thread - %message%n%xException + + + + + + %coloredLevel %logger{15} - %message%n%xException{10} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache new file mode 100644 index 00000000000..4b37d4c35d7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache @@ -0,0 +1,22 @@ +package {{package}}; + +import java.util.Objects; +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.*; +{{/useBeanValidation}} +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache new file mode 100644 index 00000000000..e19bbf893cb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache @@ -0,0 +1,24 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}}ControllerImp { +{{#operation}} + {{>returnTypes}} {{operationId}}({{#allParams}}{{>pathParamsNoDoc}}{{>queryParamsNoDoc}}{{>bodyParamsNoDoc}}{{>formParamsNoDoc}}{{>headerParamsNoDoc}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + //Do your magic!!! + {{#returnType}}return new {{>returnTypesNoVoidNoAbstract}}();{{/returnType}} + } + +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache new file mode 100644 index 00000000000..bd76a507cae --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -0,0 +1,162 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import io.swagger.annotations.*; +import play.mvc.Controller; +import play.mvc.Result; +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import java.io.IOException; +import swagger.SwaggerUtils; +import javafx.util.Pair; +import com.fasterxml.jackson.core.type.TypeReference; + +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} + +{{>generatedAnnotation}} +@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") +{{#operations}} +public class {{classname}}Controller extends Controller { + + private {{classname}}ControllerImp imp; + private ObjectMapper mapper; + + @Inject + private {{classname}}Controller({{classname}}ControllerImp imp) { + this.imp = imp; + mapper = new ObjectMapper(); + } + +{{#operation}} + + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#returnType}}, response = {{{returnType}}}.class{{/returnType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#returnType}}, response = {{{returnType}}}.class{{/returnType}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) + {{#hasParams}} + @ApiImplicitParams({ + {{#allParams}}{{^isPathParam}}@ApiImplicitParam(name = "{{baseName}}", value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}, dataType = "{{{dataTypeForImplicitParam}}}", paramType = "{{>paramType}}"){{#hasMore}}, + {{/hasMore}}{{/isPathParam}}{{/allParams}} + }) + {{/hasParams}} + public Result {{operationId}}({{#pathParams}}{{>pathParams}}{{#hasMore}},{{/hasMore}}{{/pathParams}}) {{#bodyParams}}throws IOException{{/bodyParams}} { + {{#bodyParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + {{/collectionFormat}} + {{^collectionFormat}} + JsonNode node{{paramName}} = request().body().asJson(); + {{{dataType}}} {{paramName}}; + {{^required}} + if (node{{paramName}} != null) { + {{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{#isMapContainer}}new TypeReference>(){}{{/isMapContainer}}{{#isListContainer}}new TypeReference>(){}{{/isListContainer}}{{^isListContainer}}{{^isMapContainer}}{{{dataType}}}.class{{/isMapContainer}}{{/isListContainer}});{{/required}} + {{#required}}{{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{{dataType}}}.class);{{/required}} + {{^required}} + } else { + {{paramName}} = null; + }{{/required}} + {{/collectionFormat}} + {{/bodyParams}} + {{#queryParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getQueryString("{{baseName}}")); + {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = request().getQueryString("{{paramName}}"); + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/queryParams}} + {{#formParams}} + {{^notFile}} + Http.MultipartFormData.FilePart {{paramName}} = request().body().asMultipartFormData().getFile("{{baseName}}"); + {{#required}}if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) { + throw new RuntimeException("File cannot be empty"); + } + {{/required}} + {{/notFile}} + {{#notFile}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]); + {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]; + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/notFile}} + {{/formParams}} + {{#headerParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getHeader("{{baseName}}")); + //{{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = request().getHeader("{{baseName}}"); + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/headerParams}} + {{#returnType}}{{>returnTypesNoVoid}} obj = {{/returnType}}imp.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}JsonNode result = mapper.valueToTree(obj); + return ok(result);{{/returnType}} + {{^returnType}}return ok();{{/returnType}} + } +{{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache new file mode 100644 index 00000000000..1bd5e207d7b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache @@ -0,0 +1,10 @@ +package {{apiPackage}}; + +{{>generatedAnnotation}} +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache new file mode 100644 index 00000000000..a24853098c0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache @@ -0,0 +1 @@ +{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache new file mode 100644 index 00000000000..4871bc3ada2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache @@ -0,0 +1 @@ +{{#isPathParam}}path{{/isPathParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isFormParam}}form{{/isFormParam}}{{#isBodyParam}}body{{/isBodyParam}}{{#isHeaderParam}}header{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache new file mode 100644 index 00000000000..190ebbb3fe2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache new file mode 100644 index 00000000000..4dce26e1cea --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache new file mode 100644 index 00000000000..ca73a99c721 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache @@ -0,0 +1,2 @@ +// The Play plugin +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10") diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache new file mode 100644 index 00000000000..d1422e2b1fc --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -0,0 +1,118 @@ +/** + * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + */{{#description}} +@ApiModel(description = "{{{description}}}"){{/description}} +{{>generatedAnnotation}} +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{/isEnum}} + {{#items.isEnum}} + {{#items}} + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{/items}} + {{/items.isEnum}} + {{#jackson}} + @JsonProperty("{{baseName}}") + {{/jackson}} + {{#gson}} + @SerializedName("{{baseName}}") + {{/gson}} + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; + + {{/vars}} + {{#vars}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isListContainer}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.add({{name}}Item); + return this; + } + {{/isListContainer}} + {{#isMapContainer}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMapContainer}} + + /** + {{#description}} + * {{{description}}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{minimum}} + {{/minimum}} + {{#maximum}} + * maximum: {{maximum}} + {{/maximum}} + * @return {{name}} + **/ + {{#vendorExtensions.extraAnnotation}} + {{{vendorExtensions.extraAnnotation}}} + {{/vendorExtensions.extraAnnotation}} + @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + {{/vars}} + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}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/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties new file mode 100644 index 00000000000..a8c2f849be3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.12.0 diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt new file mode 100644 index 00000000000..713b7f3e993 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt @@ -0,0 +1,9 @@ +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4") + +libraryDependencies <+= sbtVersion(v => v match { + case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8" + case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10" + case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11" + case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1" + case x if (x.startsWith("0.12")) => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1" +}) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache new file mode 100644 index 00000000000..e3fd6c6ce76 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache new file mode 100644 index 00000000000..dbc2e613707 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}}{{^returnType}}void{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache new file mode 100644 index 00000000000..aba24782e7e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache new file mode 100644 index 00000000000..39f2c32c4d1 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}HashMap{{/isMapContainer}}{{#isListContainer}}ArrayList<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache new file mode 100644 index 00000000000..2ed34dbcd1d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache @@ -0,0 +1,27 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# ~~~~ + +GET /api controllers.ApiDocController.api + +{{#apiInfo}} +{{#apis}} + +#Functions for {{{baseName}}} API +{{#operations}} +{{#operation}} +{{httpMethod}} {{path}} controllers.{{classname}}Controller.{{operationId}}({{#pathParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) + +GET /api-docs controllers.ApiHelpController.getResources +{{#apiInfo}} +{{#apis}} +GET /api-docs.json/{{{baseName}}} controllers.ApiHelpController.getResource(path = "/{{{baseName}}}") +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache new file mode 100644 index 00000000000..99f8d84b739 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache @@ -0,0 +1,108 @@ +package swagger; + +import javafx.util.Pair; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +public class SwaggerUtils { + + /** + * Format to {@code Pair} objects. + * + * @param collectionFormat collection format (e.g. csv, tsv) + * @param name Name + * @param value Value + * @return A list of Pair objects + */ + public static List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + + // create the params based on the collection format + if (collectionFormat.equals("multi")) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if (collectionFormat.equals("csv")) { + delimiter = ","; + } else if (collectionFormat.equals("ssv")) { + delimiter = " "; + } else if (collectionFormat.equals("tsv")) { + delimiter = "\t"; + } else if (collectionFormat.equals("pipes")) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDatetime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Format the given Date object into string (Datetime format). + * + * @param date Date object + * @return Formatted datetime in string representation + */ + public static String formatDatetime(Date date) { + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache new file mode 100644 index 00000000000..b3083e788d9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache @@ -0,0 +1,7 @@ +{{#jackson}} +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator}}", visible = true ) +@JsonSubTypes({ + {{#children}} + @JsonSubTypes.Type(value = {{name}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), + {{/children}} +}){{/jackson}} diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 2586fac929e..91d363e0965 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -41,6 +41,7 @@ io.swagger.codegen.languages.SinatraServerCodegen io.swagger.codegen.languages.Rails5ServerCodegen io.swagger.codegen.languages.SlimFrameworkServerCodegen io.swagger.codegen.languages.SpringCodegen +io.swagger.codegen.languages.JavaPlayFrameworkCodegen io.swagger.codegen.languages.StaticDocCodegen io.swagger.codegen.languages.StaticHtmlGenerator io.swagger.codegen.languages.StaticHtml2Generator diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java new file mode 100644 index 00000000000..a6873db28ad --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java @@ -0,0 +1,68 @@ +package io.swagger.codegen.javaPlayFramework; + +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.java.JavaClientOptionsTest; +import io.swagger.codegen.languages.JavaPlayFrameworkCodegen; +import io.swagger.codegen.options.JavaPlayFrameworkOptionsProvider; +import mockit.Expectations; +import mockit.Tested; + +public class JavaPlayFrameworkOptionsTest extends JavaClientOptionsTest { + + @Tested + private JavaPlayFrameworkCodegen clientCodegen; + + public JavaPlayFrameworkOptionsTest() { + super(new JavaPlayFrameworkOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void setExpectations() { + new Expectations(clientCodegen) {{ + clientCodegen.setModelPackage(JavaPlayFrameworkOptionsProvider.MODEL_PACKAGE_VALUE); + times = 1; + clientCodegen.setApiPackage(JavaPlayFrameworkOptionsProvider.API_PACKAGE_VALUE); + times = 1; + clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SORT_PARAMS_VALUE)); + times = 1; + clientCodegen.setInvokerPackage(JavaPlayFrameworkOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; + clientCodegen.setGroupId(JavaPlayFrameworkOptionsProvider.GROUP_ID_VALUE); + times = 1; + clientCodegen.setArtifactId(JavaPlayFrameworkOptionsProvider.ARTIFACT_ID_VALUE); + times = 1; + clientCodegen.setArtifactVersion(JavaPlayFrameworkOptionsProvider.ARTIFACT_VERSION_VALUE); + times = 1; + clientCodegen.setSourceFolder(JavaPlayFrameworkOptionsProvider.SOURCE_FOLDER_VALUE); + times = 1; + clientCodegen.setLocalVariablePrefix(JavaPlayFrameworkOptionsProvider.LOCAL_PREFIX_VALUE); + times = 1; + clientCodegen.setSerializableModel(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SERIALIZABLE_MODEL_VALUE)); + times = 1; + clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.FULL_JAVA_UTIL_VALUE)); + times = 1; + clientCodegen.setTitle(JavaPlayFrameworkOptionsProvider.TITLE); + times = 1; + clientCodegen.setConfigPackage(JavaPlayFrameworkOptionsProvider.CONFIG_PACKAGE_VALUE); + times = 1; + clientCodegen.setBasePackage(JavaPlayFrameworkOptionsProvider.BASE_PACKAGE_VALUE); + times = 1; + clientCodegen.setControllerOnly(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.CONTROLLER_ONLY)); + times = 1; + clientCodegen.setSingleContentTypes(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SINGLE_CONTENT_TYPES)); + times = 1; + clientCodegen.setResponseWrapper(JavaPlayFrameworkOptionsProvider.RESPONSE_WRAPPER); + times = 1; + clientCodegen.setUseTags(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.USE_TAGS)); + times = 1; + clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.USE_BEANVALIDATION)); + times = 1; + }}; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java new file mode 100644 index 00000000000..b0971b2e475 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java @@ -0,0 +1,42 @@ +package io.swagger.codegen.options; + +import io.swagger.codegen.languages.JavaPlayFrameworkCodegen; + +import java.util.HashMap; +import java.util.Map; + +public class JavaPlayFrameworkOptionsProvider extends JavaOptionsProvider { + public static final String TITLE = "swagger"; + public static final String CONFIG_PACKAGE_VALUE = "configPackage"; + public static final String BASE_PACKAGE_VALUE = "basePackage"; + public static final String CONTROLLER_ONLY = "true"; + public static final String SINGLE_CONTENT_TYPES = "true"; + public static final String RESPONSE_WRAPPER = "Callable"; + public static final String USE_TAGS = "useTags"; + public static final String USE_BEANVALIDATION = "true"; + + @Override + public String getLanguage() { + return "javaPlayFramework"; + } + + @Override + public Map createOptions() { + Map options = new HashMap(super.createOptions()); + options.put(JavaPlayFrameworkCodegen.TITLE, TITLE); + options.put(JavaPlayFrameworkCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE); + options.put(JavaPlayFrameworkCodegen.BASE_PACKAGE, BASE_PACKAGE_VALUE); + options.put(JavaPlayFrameworkCodegen.CONTROLLER_ONLY, CONTROLLER_ONLY); + options.put(JavaPlayFrameworkCodegen.SINGLE_CONTENT_TYPES, SINGLE_CONTENT_TYPES); + options.put(JavaPlayFrameworkCodegen.RESPONSE_WRAPPER, RESPONSE_WRAPPER); + options.put(JavaPlayFrameworkCodegen.USE_TAGS, USE_TAGS); + options.put(JavaPlayFrameworkCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + + return options; + } + + @Override + public boolean isServer() { + return true; + } +} From d9ee34e250e64596fd1109a35d47591277b0f945 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 10 Mar 2017 22:22:40 +0800 Subject: [PATCH 105/132] Update travis.yml to cover Java-related server stubs (#4992) * update travis to cover more test cases * update artifactid * update artifactid for msf4j * update pom for better test naming --- pom.xml | 10 ++++++++-- samples/server/petstore/java-msf4j/pom.xml | 9 +++------ .../petstore/jaxrs-cxf-annotated-base-path/pom.xml | 4 ++-- .../server/petstore/jaxrs-cxf-non-spring-app/pom.xml | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 72aeb6df506..097a1cdb6af 100644 --- a/pom.xml +++ b/pom.xml @@ -779,6 +779,8 @@ samples/client/petstore/typescript-fetch/tests/default samples/client/petstore/typescript-angular samples/client/petstore/typescript-node/npm + + samples/server/petstore/java-inflector samples/server/petstore/undertow @@ -790,8 +792,12 @@ samples/server/petstore/spring-mvc samples/client/petstore/spring-cloud samples/server/petstore/springboot - - + samples/server/petstore/jaxrs-cxf + samples/server/petstore/jaxrs-cxf-annotated-base-path + samples/server/petstore/jaxrs-cxf-cdi + samples/server/petstore/jaxrs-cxf-non-spring-app + + diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index 84aac08e9d3..d25dba1ac73 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -1,17 +1,14 @@ - - org.wso2.msf4j msf4j-service -2.0.0 + 2.0.0 - 4.0.0 io.swagger - swagger-jaxrs-server + swagger-msf4j-server jar - swagger-jaxrs-server + swagger-msf4j-server 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index cdf3a68ed8f..b12ecaa443f 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-cxf-server + swagger-cxf-annotated-basepath war - swagger-cxf-server + swagger-cxf-annotated-basepath 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index cdf3a68ed8f..d2fcf897e07 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-cxf-server + swagger-cxf-server-non-spring war - swagger-cxf-server + swagger-cxf-non-spring 1.0.0 src/main/java From 3da86543362c3dc9ed4862895e35649e015410c9 Mon Sep 17 00:00:00 2001 From: Julien Dupouy Date: Fri, 10 Mar 2017 18:05:27 +0100 Subject: [PATCH 106/132] Change build call visibility --- .../resources/Java/libraries/okhttp-gson/api.mustache | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache index a6f66172c01..49f9ea0a6a6 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -63,8 +63,15 @@ public class {{classname}} { } {{#operation}} - /* Build call for {{operationId}} */ - private com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for {{operationId}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables From db4945fdbff8f7fa008d3203ed5302cde50b29fc Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 10 Mar 2017 09:30:49 -0800 Subject: [PATCH 107/132] added type check --- .../codegen/languages/BashClientCodegen.java | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java index eae094e6335..8ee22c57c84 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java @@ -1,29 +1,31 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; -import io.swagger.models.properties.*; -import io.swagger.models.parameters.*; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.codegen.SupportingFile; import io.swagger.models.Model; import io.swagger.models.Operation; import io.swagger.models.Swagger; +import io.swagger.models.parameters.BodyParameter; +import io.swagger.models.parameters.Parameter; +import io.swagger.models.parameters.SerializableParameter; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; - import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import java.util.HashMap; + +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.*; -import java.io.File; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.Set; public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -571,16 +573,17 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { List codesamples = (List)op.vendorExtensions.get("x-code-samples"); for (Object codesample : codesamples) { - ObjectNode codesample_object = (ObjectNode)codesample; + if(codesample instanceof ObjectNode) { + ObjectNode codesample_object = (ObjectNode) codesample; - if((codesample_object.get("lang").asText()).equals("Shell")) { + if ((codesample_object.get("lang").asText()).equals("Shell")) { - op.vendorExtensions.put("x-bash-codegen-sample", - escapeUnsafeCharacters( - codesample_object.get("source").asText())); - - } + op.vendorExtensions.put("x-bash-codegen-sample", + escapeUnsafeCharacters( + codesample_object.get("source").asText())); + } + } } } From f9835a4b37494f4274007635f0e8414cdeacd26d Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 10 Mar 2017 09:31:02 -0800 Subject: [PATCH 108/132] matched key to actual value --- .../java/io/swagger/codegen/bash/BashTest.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java index 4f355723a7f..dec0d8ddd4a 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java @@ -1,30 +1,14 @@ package io.swagger.codegen.bash; -import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenOperation; -import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.languages.BashClientCodegen; -import io.swagger.models.ArrayModel; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; import io.swagger.models.Operation; import io.swagger.models.Swagger; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.DateTimeProperty; -import io.swagger.models.properties.LongProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import io.swagger.parser.SwaggerParser; - import org.testng.Assert; import org.testng.annotations.Test; -import org.testng.annotations.ITestAnnotation; - -import com.google.common.collect.Sets; -import java.util.Map; @SuppressWarnings("static-method") public class BashTest { @@ -48,7 +32,7 @@ public class BashTest { swagger); Assert.assertTrue( - op.vendorExtensions.containsKey("x-bash-codegen-sample")); + op.vendorExtensions.containsKey("x-code-samples")); Assert.assertEquals( op.vendorExtensions.get("x-bash-codegen-description"), From a29c8c937a8468e2084ea3d2ae6443576c0dabfc Mon Sep 17 00:00:00 2001 From: ravinikam Date: Fri, 10 Mar 2017 12:41:15 -0600 Subject: [PATCH 109/132] Update exception message to use operationId Update ApiException to use {{operationId}} variable to correct typo --- .../src/main/resources/cpprest/api-source.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache index 30724132edb..28f4861b9b6 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache @@ -344,7 +344,7 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling {{operationId}}: unsupported response type")); } return result; From 0dcd91adbf68cd7bba0cd2adcc3736ab3970e1d1 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 10 Mar 2017 11:07:30 -0800 Subject: [PATCH 110/132] null out the string `null` in examples. Rebuilt java clients and made a whole bunch of changes --- .../io/swagger/codegen/DefaultCodegen.java | 5 +++- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../petstore/java/jersey1/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../java/jersey2-java8/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../petstore/java/jersey2/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../petstore/java/okhttp-gson/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../java/retrofit2-play24/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../petstore/java/retrofit2/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ .../petstore/java/retrofit2rx/docs/FakeApi.md | 4 +-- .../model/AdditionalPropertiesClass.java | 4 +-- .../java/io/swagger/client/model/Animal.java | 4 +-- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 ++--- .../swagger/client/model/Capitalization.java | 12 ++++----- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +-- .../io/swagger/client/model/ClassModel.java | 2 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +-- .../io/swagger/client/model/EnumTest.java | 8 +++--- .../io/swagger/client/model/FormatTest.java | 26 +++++++++---------- .../swagger/client/model/HasOnlyReadOnly.java | 4 +-- .../java/io/swagger/client/model/MapTest.java | 4 +-- ...ropertiesAndAdditionalPropertiesClass.java | 6 ++--- .../client/model/Model200Response.java | 4 +-- .../client/model/ModelApiResponse.java | 6 ++--- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +++--- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 ++++----- .../java/io/swagger/client/model/Pet.java | 10 +++---- .../swagger/client/model/ReadOnlyFirst.java | 4 +-- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +-- .../java/io/swagger/client/model/User.java | 16 ++++++------ 260 files changed, 756 insertions(+), 753 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 586a95fefb4..d9c44e12da1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1481,7 +1481,10 @@ public class DefaultCodegen { property.title = p.getTitle(); property.getter = "get" + getterAndSetterCapitalize(name); property.setter = "set" + getterAndSetterCapitalize(name); - property.example = toExampleValue(p); + String example = toExampleValue(p); + if(!"null".equals(example)) { + property.example = example; + } property.defaultValue = toDefaultValue(p); property.defaultValueWithParam = toDefaultValueWithParam(name, p); property.jsonSchema = Json.pretty(p); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index b54f66cdfd0..81e63c352ee 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8ece04d15e1..4f15788bc4e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } 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 index 4c40105822e..4d183d4877d 100644 --- 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 @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } 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 index 43f7719bd42..500ce3f5fc3 100644 --- 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 @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } 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 index 1f9bffa1a61..1ebeccb2e01 100644 --- 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 @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 99a852d7403..7f89c63b447 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } 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 index 33a39234153..96baa57047b 100644 --- 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 @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 284ae074be9..4deb6e1d851 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java index b54f66cdfd0..81e63c352ee 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8ece04d15e1..4f15788bc4e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index 99a852d7403..7f89c63b447 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 651c9d0c43f..0e370b3862f 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java index 0904135b735..cac28a9d336 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b62601da3ef..314de8aef1b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 048db164342..296fddfe10d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 284ae074be9..4deb6e1d851 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java index b54f66cdfd0..81e63c352ee 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8ece04d15e1..4f15788bc4e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index 99a852d7403..7f89c63b447 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 284ae074be9..4deb6e1d851 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java index db1dc0c9008..15d3cbe3c69 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index b79593fdb6a..e52a1656493 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 89fce6dad9e..13487e7e351 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java index fd05d6e9bef..768361db92c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java index f5f3aef8f57..fa6b9b0fadd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java index 77acc1e2230..c6ce300e7b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java index de5cc9a6d3a..52c53649506 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index 3d0ee70b1b5..8b330f6ebbf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java index 5951ebc5aa6..014d8367d47 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java index c53f7ceb050..425b10ed435 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java index 19635b3b5b0..b64e15e422c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } 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 db1dc0c9008..15d3cbe3c69 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 @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java index b79593fdb6a..e52a1656493 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 89fce6dad9e..13487e7e351 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } 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 index fd05d6e9bef..768361db92c 100644 --- 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 @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } 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 index f5f3aef8f57..fa6b9b0fadd 100644 --- 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 @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } 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 index 77acc1e2230..c6ce300e7b2 100644 --- 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 @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } 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 de5cc9a6d3a..52c53649506 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 @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } 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 3d0ee70b1b5..8b330f6ebbf 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 @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } 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 index 5951ebc5aa6..014d8367d47 100644 --- 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 @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } 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 c53f7ceb050..425b10ed435 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 @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } 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 19635b3b5b0..b64e15e422c 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 @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index d1f45eda4d4..3565773358e 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -177,8 +177,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index d64d61f3c52..073f605cd49 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -71,7 +71,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java index 32cf42cdd74..3009c1fb4a6 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java @@ -48,7 +48,7 @@ public class Animal { * @return className **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -66,7 +66,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 2e8235c8c49..a59dccde4e2 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 4d909396195..5872c2e7749 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java index 29b73261642..9bf3e2bb705 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -74,7 +74,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -97,7 +97,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java index 6aa8eb59dc5..2fa81e5d61f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java @@ -52,7 +52,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -70,7 +70,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -88,7 +88,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -106,7 +106,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -124,7 +124,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -142,7 +142,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java index a04574c0ea9..4114f80908a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java @@ -38,7 +38,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java index c8691c3ee4f..75d5aed3dc9 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java @@ -40,7 +40,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java index 5fe97c0b21c..fcc4b60d2c1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java @@ -38,7 +38,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java index f2f6c4b6130..56ef2a6f917 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java @@ -37,7 +37,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java index 9e18aa16b51..5d51058223e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java @@ -38,7 +38,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index 973534c6c1d..c0aa3ca485f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -102,7 +102,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -125,7 +125,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java index 38fa33789f3..1c2b7b18f38 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java @@ -139,7 +139,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -157,7 +157,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -175,7 +175,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -193,7 +193,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index 8beb242e21d..3449c798d9b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -79,7 +79,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) @Max(100) @ApiModelProperty(example = "null", value = "") + @Min(10) @Max(100) @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -99,7 +99,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) @Max(200) @ApiModelProperty(example = "null", value = "") + @Min(20) @Max(200) @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -117,7 +117,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -138,7 +138,7 @@ public class FormatTest { * @return number **/ @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(example = "null", required = true, value = "") + @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -158,7 +158,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(example = "null", value = "") + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -178,7 +178,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(example = "null", value = "") + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -196,7 +196,7 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") @ApiModelProperty(example = "null", value = "") + @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") public String getString() { return string; } @@ -215,7 +215,7 @@ public class FormatTest { * @return _byte **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -233,7 +233,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -252,7 +252,7 @@ public class FormatTest { * @return date **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -270,7 +270,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -288,7 +288,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -307,7 +307,7 @@ public class FormatTest { * @return password **/ @NotNull - @Size(min=10,max=64) @ApiModelProperty(example = "null", required = true, value = "") + @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6a96f1964a0..dee7f0bd29b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -44,7 +44,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 4db64f866f5..f703cd5ecf5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -78,7 +78,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -101,7 +101,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index de5512b1652..43365328233 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -67,7 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -90,7 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java index 8142243744e..e01123c868f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java @@ -41,7 +41,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java index 0fdfa8f52f7..f3caa44435d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -43,7 +43,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -61,7 +61,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -79,7 +79,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java index 1e4ae4973d3..8cc3bd148ab 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java @@ -38,7 +38,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java index 872603a2329..78cd0326f32 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java @@ -48,7 +48,7 @@ public class Name { * @return name **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -61,7 +61,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -75,7 +75,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -88,7 +88,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java index 06fdd444d86..c838c8ad9b3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java @@ -38,7 +38,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 6f0be730175..c3b34bdc2eb 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -85,7 +85,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -103,7 +103,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -121,7 +121,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -139,7 +139,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -157,7 +157,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -175,7 +175,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index 0bb51a4f5c0..e90e3f7df24 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -88,7 +88,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -106,7 +106,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -149,7 +149,7 @@ public class Pet { * @return photoUrls **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -172,7 +172,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -190,7 +190,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 7b9247bb24e..72bed951737 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -35,7 +35,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -49,7 +49,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java index 480fb41e9ea..058d6156f48 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -37,7 +37,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java index 271c21de570..97110c9fffd 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java @@ -40,7 +40,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java index dfec21c2a96..4827937f0e6 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java @@ -58,7 +58,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -76,7 +76,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -94,7 +94,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -112,7 +112,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -130,7 +130,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -148,7 +148,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -166,7 +166,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -184,7 +184,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index d1f45eda4d4..3565773358e 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -177,8 +177,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } 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 db1dc0c9008..15d3cbe3c69 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 @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java index b79593fdb6a..e52a1656493 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 89fce6dad9e..13487e7e351 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } 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 index fd05d6e9bef..768361db92c 100644 --- 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 @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } 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 index f5f3aef8f57..fa6b9b0fadd 100644 --- 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 @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } 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 index 77acc1e2230..c6ce300e7b2 100644 --- 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 @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } 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 de5cc9a6d3a..52c53649506 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 @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } 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 3d0ee70b1b5..8b330f6ebbf 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 @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } 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 5951ebc5aa6..014d8367d47 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 @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } 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 c53f7ceb050..425b10ed435 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 @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } 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 19635b3b5b0..b64e15e422c 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 @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index d1f45eda4d4..3565773358e 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -177,8 +177,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } 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 db1dc0c9008..15d3cbe3c69 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 @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index b79593fdb6a..e52a1656493 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 89fce6dad9e..13487e7e351 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } 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 index fd05d6e9bef..768361db92c 100644 --- 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 @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } 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 index f5f3aef8f57..fa6b9b0fadd 100644 --- 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 @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } 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 index 77acc1e2230..c6ce300e7b2 100644 --- 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 @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } 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 de5cc9a6d3a..52c53649506 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 @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } 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 3d0ee70b1b5..8b330f6ebbf 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 @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } 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 5951ebc5aa6..014d8367d47 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 @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } 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 c53f7ceb050..425b10ed435 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 @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } 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 19635b3b5b0..b64e15e422c 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 @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } From dfc0b7e3f8d8f425956a1a2883ef6d2016d3b547 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 10 Mar 2017 20:53:03 -0800 Subject: [PATCH 111/132] Updated parser to release version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 315c8ad5cf7..17963d59936 100644 --- a/pom.xml +++ b/pom.xml @@ -869,7 +869,7 @@ - 1.0.27-SNAPSHOT + 1.0.28 2.11.1 2.3.4 1.5.12 From 8fb71b46db62a20ac710875562b8626e081bd2d4 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 11 Mar 2017 16:59:17 +0800 Subject: [PATCH 112/132] cache module directory to improve CI performance (#5025) --- .gitignore | 2 ++ .travis.yml | 15 +++++++++++++++ samples/client/petstore/ruby/pom.xml | 2 ++ 3 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index f49332b6615..370da9c3256 100644 --- a/.gitignore +++ b/.gitignore @@ -143,6 +143,8 @@ samples/client/petstore/typescript-node/**/typings samples/client/petstore/typescript-angular/**/typings samples/client/petstore/typescript-fetch/**/dist/ samples/client/petstore/typescript-fetch/**/typings +samples/client/petstore/typescript-angular2/npm/npm-debug.log +samples/client/petstore/typescript-node/npm/npm-debug.log # aspnetcore samples/server/petstore/aspnetcore/.vs/ diff --git a/.travis.yml b/.travis.yml index e0290b10205..b3fdc788324 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,21 @@ jdk: cache: directories: - $HOME/.m2 + - $HOME/samples/client/petstore/php/SwaggerClient-php/vendor + - $HOME/samples/client/petstore/ruby/venodr/bundle + - $HOME/samples/client/petstore/python/.venv/ + - $HOME/samples/client/petstore/typescript-node/npm/node_modules + - $HOME/samples/client/petstore/typescript-node/npm/typings/ + - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules + - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules + - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules + - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules + - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings + - $HOME/samples/client/petstore/typescript-angular/node_modules + - $HOME/samples/client/petstore/typescript-angular/typings services: - docker diff --git a/samples/client/petstore/ruby/pom.xml b/samples/client/petstore/ruby/pom.xml index 85b6268cc9e..2e720e226b2 100644 --- a/samples/client/petstore/ruby/pom.xml +++ b/samples/client/petstore/ruby/pom.xml @@ -36,6 +36,8 @@ bundle install + --path + vendor/bundle From 3c1a8daaf920af7a5eecf17f3fb157f083ca6366 Mon Sep 17 00:00:00 2001 From: XuXinkun Date: Sat, 11 Mar 2017 17:02:49 +0800 Subject: [PATCH 113/132] fix handleResponse to not leak okhttp connections (#4997) --- .../Java/libraries/okhttp-gson/ApiClient.mustache | 7 +++++++ .../src/main/java/io/swagger/client/ApiClient.java | 7 +++++++ .../src/main/java/io/swagger/client/ApiClient.java | 7 +++++++ .../src/main/java/io/swagger/client/ApiClient.java | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index a3f73d0b27b..b119a5e35ef 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1027,6 +1027,13 @@ public class ApiClient { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } return null; } else { return deserialize(response, returnType); diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 076c4c09a10..6a443dd2a9f 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -1032,6 +1032,13 @@ public class ApiClient { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } return null; } else { return deserialize(response, returnType); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index d014d7d4035..83fc162bf4d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -1033,6 +1033,13 @@ public class ApiClient { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } return null; } else { return deserialize(response, returnType); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 64e0e9a04a9..bc13f2113d7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -1034,6 +1034,13 @@ public class ApiClient { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } return null; } else { return deserialize(response, returnType); From 2b9b0f31dc6b787c85a3db911de42dbc5a412389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sat, 11 Mar 2017 10:29:59 +0100 Subject: [PATCH 114/132] remove indentation of the comment (#5011) This template seems to lead to people wrapping their code with indented code markers, which won't work. Hopefully not indenting it here helps a bit. --- .github/ISSUE_TEMPLATE.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 89e344b08d2..277a7741fab 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -14,17 +14,17 @@ Also please indicate in the issue title which language/library is concerned. Eg: ##### Swagger declaration file content or url ##### Command line used for generation From 0ce6c7e3a8ad93c8c8a49b41b75a7f31561d75ce Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 11 Mar 2017 20:32:46 +0800 Subject: [PATCH 115/132] do not map UUID as model in java (#5026) --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 1 + .../swagger/codegen/languages/AbstractJavaCodegen.java | 2 ++ .../swagger/codegen/languages/JavaClientCodegen.java | 10 +++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index d9c44e12da1..463ded80774 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -811,6 +811,7 @@ public class DefaultCodegen { typeMapping.put("ByteArray", "byte[]"); typeMapping.put("binary", "byte[]"); typeMapping.put("file", "File"); + typeMapping.put("UUID", "UUID"); instantiationTypes = new HashMap(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 5d5c986d113..17a3da73650 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -317,6 +317,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code typeMapping.put("array", "java.util.List"); typeMapping.put("map", "java.util.Map"); typeMapping.put("DateTime", "java.util.Date"); + typeMapping.put("UUID", "java.util.UUID"); typeMapping.remove("List"); importMapping.remove("Date"); importMapping.remove("Map"); @@ -326,6 +327,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code importMapping.remove("List"); importMapping.remove("Set"); importMapping.remove("DateTime"); + importMapping.remove("UUID"); instantiationTypes.put("array", "java.util.ArrayList"); instantiationTypes.put("map", "java.util.HashMap"); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index b9152047f38..b8d24109f04 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -19,7 +19,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen { static final String MEDIA_TYPE = "mediaType"; - @SuppressWarnings("hiding") + @SuppressWarnings("hiding") private static final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); public static final String USE_RX_JAVA = "useRxJava"; @@ -102,9 +102,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen if (additionalProperties.containsKey(USE_RX_JAVA2)) { this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString())); } - if (!useRxJava && !useRxJava2) { - additionalProperties.put(DO_NOT_USE_RX, true); - } + if (!useRxJava && !useRxJava2) { + additionalProperties.put(DO_NOT_USE_RX, true); + } if (additionalProperties.containsKey(USE_PLAY24_WS)) { this.setUsePlay24WS(Boolean.valueOf(additionalProperties.get(USE_PLAY24_WS).toString())); } @@ -250,7 +250,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen if ( isMultipartType(operation.consumes) ) { operation.isMultipart = Boolean.TRUE; - } + } else { operation.prioritizedContentTypes = prioritizeContentTypes(operation.consumes); } From 82ccbc09f72c9b88d7e3c52740dbcf45b1bc36c8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 11 Mar 2017 20:40:22 +0800 Subject: [PATCH 116/132] update cpprest petstore sample --- samples/client/petstore/cpprest/api/PetApi.cpp | 6 +++--- samples/client/petstore/cpprest/api/StoreApi.cpp | 6 +++--- samples/client/petstore/cpprest/api/UserApi.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index aa9aab9d89c..d3e337d367f 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -518,7 +518,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling findPetsByTags: unsupported response type")); } return result; @@ -644,7 +644,7 @@ pplx::task> PetApi::getPetById(int64_t petId) else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getPetById: unsupported response type")); } return result; @@ -1005,7 +1005,7 @@ pplx::task> PetApi::uploadFile(int64_t petId, utili else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling uploadFile: unsupported response type")); } return result; diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index 39a3c6a39f7..40a6b8cfb71 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.cpp +++ b/samples/client/petstore/cpprest/api/StoreApi.cpp @@ -259,7 +259,7 @@ pplx::task> StoreApi::getInventory() else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getInventory: unsupported response type")); } return result; @@ -377,7 +377,7 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getOrderById: unsupported response type")); } return result; @@ -513,7 +513,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling placeOrder: unsupported response type")); } return result; diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index 669be733361..289295a36b5 100644 --- a/samples/client/petstore/cpprest/api/UserApi.cpp +++ b/samples/client/petstore/cpprest/api/UserApi.cpp @@ -616,7 +616,7 @@ pplx::task> UserApi::getUserByName(utility::string_t usern else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getUserByName: unsupported response type")); } return result; @@ -751,7 +751,7 @@ pplx::task UserApi::loginUser(utility::string_t username, uti else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling loginUser: unsupported response type")); } return result; From c4bd4c9e914bdf6f60fe4b05124fc566619b634e Mon Sep 17 00:00:00 2001 From: ravinikam Date: Sat, 11 Mar 2017 09:03:37 -0600 Subject: [PATCH 117/132] Add missing number type mapping (#5013) number to float or double type mapping was missing, added number to double to accommodate both. --- .../java/io/swagger/codegen/languages/CppRestClientCodegen.java | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java index ea4c358c197..7857fc765fe 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java @@ -113,6 +113,7 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi typeMapping.put("file", "HttpContent"); typeMapping.put("object", "Object"); typeMapping.put("binary", "std::string"); + typeMapping.put("number", "double"); super.importMapping = new HashMap(); importMapping.put("std::vector", "#include "); From a201b01adcd89e465b249db9a561ce3ebd2f307f Mon Sep 17 00:00:00 2001 From: Kyle Maxwell Date: Sun, 12 Mar 2017 00:11:53 -0600 Subject: [PATCH 118/132] Ultra minor spelling fix (#5029) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6f127186321..85641dcbae5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ ### PR checklist -- [ ] Read the [contribution guildelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). +- [ ] Read the [contribution guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). - [ ] Ran the shell/batch script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates) - [ ] Filed the PR against the correct branch: master for non-breaking changes and `2.3.0` branch for breaking (non-backward compatible) changes. From 16adc7b37370c87ae1e76db2e58d6b0129a53b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 12 Mar 2017 09:53:18 +0100 Subject: [PATCH 119/132] Fix (partially) #4898 for flash (#5022) * Fix (partially) #4898 for flash. This fixes path, query and header parameters. * Update samples for flash (after partial fix for #4898). --- .../swagger-codegen/src/main/resources/flash/api.mustache | 6 +++--- .../flash/flash/src/io/swagger/client/api/PetApi.as | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/flash/api.mustache b/modules/swagger-codegen/src/main/resources/flash/api.mustache index b1312a339d4..439eaed1629 100644 --- a/modules/swagger-codegen/src/main/resources/flash/api.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/api.mustache @@ -36,7 +36,7 @@ public class {{classname}} extends SwaggerApi { */ public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): String { // create path and map variables - var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{paramName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; + var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{baseName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; // query params var queryParams: Dictionary = new Dictionary(); @@ -50,10 +50,10 @@ public class {{classname}} extends SwaggerApi { {{/allParams}} {{#queryParams}}if("null" != String({{paramName}})) - queryParams["{{paramName}}"] = toPathValue({{paramName}}); + queryParams["{{baseName}}"] = toPathValue({{paramName}}); {{/queryParams}} - {{#headerParams}}headerParams["{{paramName}}"] = toPathValue({{paramName}}); + {{#headerParams}}headerParams["{{baseName}}"] = toPathValue({{paramName}}); {{/headerParams}} var token:AsyncToken = getApiInvoker().invokeAPI(path, "{{httpMethod}}", queryParams, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, headerParams); diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as index 34b1b7a395d..55c861c7e59 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as @@ -86,7 +86,7 @@ public class PetApi extends SwaggerApi { } - headerParams["apiKey"] = toPathValue(apiKey); + headerParams["api_key"] = toPathValue(apiKey); var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams); From 39eba39625d17aa064e0d5f66ea44352a6b86b1c Mon Sep 17 00:00:00 2001 From: jfiala Date: Sun, 12 Mar 2017 09:58:19 +0100 Subject: [PATCH 120/132] [Jaxrs-cxf] add ApiResponse/s to operation #4718 (#4920) * add ApiResponse/s to operation #4718 * use spaces instead of tabs #4718 * fix alignment issues #4920 * fix alignment issues #4920 * replace tabs with spaces #4920 * updated samples #4920 --- .../AbstractJavaJAXRSServerCodegen.java | 28 +++++++++++-------- .../main/resources/JavaJaxRS/cxf/api.mustache | 4 +++ .../resources/JavaJaxRS/cxf/api_test.mustache | 2 +- .../src/gen/java/io/swagger/api/FakeApi.java | 10 +++++++ .../src/gen/java/io/swagger/api/PetApi.java | 24 ++++++++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 14 ++++++++++ .../src/gen/java/io/swagger/api/UserApi.java | 23 +++++++++++++++ .../test/java/io/swagger/api/FakeApiTest.java | 6 ++-- .../test/java/io/swagger/api/PetApiTest.java | 10 +++---- .../java/io/swagger/api/StoreApiTest.java | 4 +-- .../test/java/io/swagger/api/UserApiTest.java | 4 +-- 11 files changed, 105 insertions(+), 24 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 3dc349edb70..4f935161730 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -21,7 +21,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen protected String testResourcesFolder = "src/test/resources"; protected String title = "Swagger Server"; - protected boolean useBeanValidation = true; + protected boolean useBeanValidation = true; static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); @@ -44,7 +44,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC)); cliOptions.add(new CliOption("title", "a title describing the application")); - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); } @@ -67,13 +67,13 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); } - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } - if (useBeanValidation) { - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - } + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } } @@ -153,6 +153,12 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen if ( "0".equals(resp.code) ) { resp.code = "200"; } + + // set vendorExtensions.x-java-is-response-void to true as dataType is set to "void" + if (resp.dataType == null) { + resp.vendorExtensions.put("x-java-is-response-void", true); + } + } } @@ -220,8 +226,8 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen return outputFolder + "/" + output + "/" + apiPackage().replace('.', '/'); } - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache index b15a8797154..c4b66f04d32 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; {{#useBeanValidation}} import javax.validation.constraints.*; @@ -38,6 +40,8 @@ public interface {{classname}} { @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }) {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache index 919e7d38206..947f4301bfb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache @@ -103,7 +103,7 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{^vendorExtensions.x-java-is-response-void}}//assertNotNull(response);{{/vendorExtensions.x-java-is-response-void}} // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java index 235016d8d62..4059c84a622 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -27,6 +29,8 @@ public interface FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @ApiOperation(value = "To test \"client\" model", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Client testClientModel(Client body); @POST @@ -34,6 +38,9 @@ public interface FakeApi { @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); @GET @@ -41,6 +48,9 @@ public interface FakeApi { @Consumes({ "*/*" }) @Produces({ "*/*" }) @ApiOperation(value = "To test enum parameters", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index d42bf02c74f..68701e28cc2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -27,30 +29,44 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(Pet body); @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find pet by ID", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); @PUT @@ -58,6 +74,10 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(Pet body); @POST @@ -65,6 +85,8 @@ public interface PetApi { @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); @POST @@ -72,6 +94,8 @@ public interface PetApi { @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @ApiOperation(value = "uploads an image", tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 82f00f1b28c..f6f1b34c243 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -25,24 +27,36 @@ public interface StoreApi { @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); @GET @Path("/store/inventory") @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", tags={ "store" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) public Order placeOrder(Order body); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index a28cc95b58d..172b6938f1d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -25,48 +27,69 @@ public interface UserApi { @Path("/user") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Create user", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUser(User body); @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(List body); @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(List body); @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete user", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs out current logged in user session", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", tags={ "user" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) public void updateUser(@PathParam("username") String username, User body); } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java index 5e8dae654a4..7d926943bd2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java @@ -80,7 +80,7 @@ public class FakeApiTest { @Test public void testClientModelTest() { Client body = null; - //Client response = api.testClientModel(body); + //Client response = api.testClientModel(body); //assertNotNull(response); // TODO: test validations @@ -111,7 +111,7 @@ public class FakeApiTest { javax.xml.datatype.XMLGregorianCalendar dateTime = null; String password = null; String paramCallback = null; - //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations @@ -136,7 +136,7 @@ public class FakeApiTest { String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 44cf564dec1..188fdb7b5cf 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -25,9 +25,9 @@ package io.swagger.api; -import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -117,7 +117,7 @@ public class PetApiTest { @Test public void findPetsByStatusTest() { List status = null; - //Pet response = api.findPetsByStatus(status); + //List response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations @@ -135,7 +135,7 @@ public class PetApiTest { @Test public void findPetsByTagsTest() { List tags = null; - //Pet response = api.findPetsByTags(tags); + //List response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index e54e33f0fbc..aa476b0cf0f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -96,7 +96,7 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - //Integer response = api.getInventory(); + //Map response = api.getInventory(); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 2285f3c70cf..76bb7fa5578 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -25,8 +25,8 @@ package io.swagger.api; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; From c76f006067ff9949765b9e03f03840a19a90ceeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 12 Mar 2017 10:08:48 +0100 Subject: [PATCH 121/132] fix (partially) #4898 for dart. (#5019) --- modules/swagger-codegen/src/main/resources/dart/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/dart/api.mustache b/modules/swagger-codegen/src/main/resources/dart/api.mustache index aaa9d5db1f4..f3c80aecc5b 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api.mustache @@ -25,7 +25,7 @@ class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{paramName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; + String path = "{{path}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{baseName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; // query params List queryParams = []; From 0b9aaad1c2b7f038f59ea760e22c92618aeeab1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sun, 12 Mar 2017 10:09:47 +0100 Subject: [PATCH 122/132] Build and upload Swagger Codegen CLI Docker image on release (#4912) * Run mvn in batch-mode to be less verbose on download * Build and upload Swagger Codegen CLI Docker image on release * Ensure we only push master and tags to Docker Hub --- .travis.yml | 10 ++++++---- README.md | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3fdc788324..a2732b58b64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,9 +62,11 @@ script: # fail if generators contain tab '\t' - /bin/bash ./bin/utils/detect_tab_in_java_class.sh # run integration tests defined in maven pom.xml - - mvn verify -Psamples - # docker test - - if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:$TRAVIS_TAG; fi && docker push $DOCKER_IMAGE_NAME; fi + - mvn --batch-mode verify -Psamples + # docker: build generator image and push to Docker Hub + - if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi + # docker: build cli image and push to Docker Hub + - if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi env: - - DOCKER_IMAGE_NAME=swaggerapi/swagger-generator + - DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli diff --git a/README.md b/README.md index 8e99b9cd7b2..25cbbba3482 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ docker stop $CID && docker rm $CID In the example above, `result.zip` will contain the generated client. -##### Swagger Codegen Docker Image +##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. @@ -200,7 +200,7 @@ To generate code with this image, you'll need to mount a local location as a vol Example: ``` -docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen generate \ +docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go From 366f66d82203db506184ff06b3e38a914468b08d Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 12 Mar 2017 23:05:27 +0800 Subject: [PATCH 123/132] Update link to maven jar update link with http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar instead --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25cbbba3482..6c2f4ba8c57 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,10 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes ### Prerequisites -If you're looking for the latest stable version, you can grab it directly from Sonatype.org (Java 7 runtime at a minimum): +If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ``` -wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar +wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` From 01eba1872e29e7ad4e2ed19f0bb803458fa0b94f Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 00:23:55 +0800 Subject: [PATCH 124/132] update java okhttp petstore sample --- bin/java-petstore-okhttp-gson-parcelable.sh | 4 +- .../docs/FakeApi.md | 4 +- .../docs/FormatTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../okhttp-gson-parcelableModel/effective.pom | 395 ------------------ .../java/okhttp-gson-parcelableModel/pom.xml | 91 +++- .../java/io/swagger/client/ApiClient.java | 1 + .../java/io/swagger/client/api/FakeApi.java | 59 ++- .../java/io/swagger/client/api/PetApi.java | 117 ++++-- .../java/io/swagger/client/api/StoreApi.java | 55 ++- .../java/io/swagger/client/api/UserApi.java | 111 +++-- .../model/AdditionalPropertiesClass.java | 4 +- .../java/io/swagger/client/model/Animal.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 +- .../java/io/swagger/client/model/Cat.java | 2 +- .../io/swagger/client/model/Category.java | 4 +- .../java/io/swagger/client/model/Client.java | 2 +- .../java/io/swagger/client/model/Dog.java | 2 +- .../io/swagger/client/model/EnumArrays.java | 4 +- .../io/swagger/client/model/EnumTest.java | 8 +- .../io/swagger/client/model/FormatTest.java | 37 +- .../swagger/client/model/HasOnlyReadOnly.java | 4 +- .../java/io/swagger/client/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 17 +- .../client/model/Model200Response.java | 4 +- .../client/model/ModelApiResponse.java | 6 +- .../io/swagger/client/model/ModelReturn.java | 2 +- .../java/io/swagger/client/model/Name.java | 8 +- .../io/swagger/client/model/NumberOnly.java | 2 +- .../java/io/swagger/client/model/Order.java | 12 +- .../java/io/swagger/client/model/Pet.java | 10 +- .../swagger/client/model/ReadOnlyFirst.java | 4 +- .../client/model/SpecialModelName.java | 2 +- .../java/io/swagger/client/model/Tag.java | 4 +- .../java/io/swagger/client/model/User.java | 16 +- .../java/io/swagger/client/api/FakeApi.java | 53 ++- .../java/io/swagger/client/api/PetApi.java | 93 ++++- .../java/io/swagger/client/api/StoreApi.java | 43 +- .../java/io/swagger/client/api/UserApi.java | 89 +++- 41 files changed, 660 insertions(+), 631 deletions(-) delete mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/effective.pom diff --git a/bin/java-petstore-okhttp-gson-parcelable.sh b/bin/java-petstore-okhttp-gson-parcelable.sh index e3fcd52c478..60a0908fe93 100755 --- a/bin/java-petstore-okhttp-gson-parcelable.sh +++ b/bin/java-petstore-okhttp-gson-parcelable.sh @@ -28,6 +28,6 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel -DhideGenerationTimestamp=true,parcelableModel=true" -rm -rf samples/client/petstore/java/okhttp-gson/src/main -find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main +find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 284ae074be9..4deb6e1d851 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/effective.pom b/samples/client/petstore/java/okhttp-gson-parcelableModel/effective.pom deleted file mode 100644 index cc60c017b23..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/effective.pom +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - - - - - - - - - - 4.0.0 - io.swagger - petstore-okhttp-gson-parcelable - 1.0.0 - petstore-okhttp-gson-parcelable - - 2.2.0 - - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.6.2 - 1.7 - 2.9.3 - 4.12 - 1.0.0 - 1.7 - 1.7 - 2.7.5 - UTF-8 - 1.5.9 - - - - io.swagger - swagger-annotations - 1.5.9 - compile - - - com.squareup.okhttp - okhttp - 2.7.5 - compile - - - com.squareup.okhttp - logging-interceptor - 2.7.5 - compile - - - com.google.code.gson - gson - 2.6.2 - compile - - - joda-time - joda-time - 2.9.3 - compile - - - junit - junit - 4.12 - test - - - - - - false - - central - Central Repository - https://repo.maven.apache.org/maven2 - - - - - - never - - - false - - central - Central Repository - https://repo.maven.apache.org/maven2 - - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/scripts - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/classes - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/test-classes - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/resources - - - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/resources - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target - petstore-okhttp-gson-parcelable-1.0.0 - - - - maven-antrun-plugin - 1.3 - - - maven-assembly-plugin - 2.2-beta-5 - - - maven-dependency-plugin - 2.8 - - - maven-release-plugin - 2.3.2 - - - - - - maven-surefire-plugin - 2.12 - - - default-test - test - - test - - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - 2.8 - - - package - - copy-dependencies - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/lib - - - - - - maven-jar-plugin - 2.2 - - - default-jar - package - - jar - - - - - - jar - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - gradle-test - integration-test - - exec - - - gradle - - test - - - - - - - maven-clean-plugin - 2.5 - - - default-clean - clean - - clean - - - - - - maven-resources-plugin - 2.6 - - - default-testResources - process-test-resources - - testResources - - - - default-resources - process-resources - - resources - - - - - - maven-compiler-plugin - 3.1 - - - default-compile - compile - - compile - - - - default-testCompile - test-compile - - testCompile - - - - - - maven-install-plugin - 2.4 - - - default-install - install - - install - - - - - - maven-deploy-plugin - 2.7 - - - default-deploy - deploy - - deploy - - - - - - maven-site-plugin - 3.3 - - - default-site - site - - site - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/site - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - - default-deploy - site-deploy - - deploy - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/site - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/site - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - - - - /Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/site - - \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 9998f398c10..26751c4e3af 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -2,12 +2,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 io.swagger - petstore-okhttp-gson-parcelable + swagger-petstore-okhttp-gson jar - petstore-okhttp-gson-parcelable + swagger-petstore-okhttp-gson 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java - scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen @@ -15,6 +17,23 @@ 2.2.0 + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + + @@ -97,27 +116,58 @@ - org.codehaus.mojo - exec-maven-plugin - 1.2.1 + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 - - gradle-test - integration-test - - exec - - - gradle - - test - - - + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + io.swagger @@ -144,7 +194,6 @@ joda-time ${jodatime-version} - junit @@ -157,7 +206,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 2.9.3 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index 83fc162bf4d..bc13f2113d7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -139,6 +139,7 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + verifyingSsl = true; json = new JSON(this); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java index d11b40fa058..81d39fcedba 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java @@ -57,12 +57,19 @@ public class FakeApi { this.apiClient = apiClient; } - /* Build call for testClientModel */ - private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClientModel + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -175,12 +182,32 @@ public class FakeApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for testEndpointParameters */ - private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEndpointParameters + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -371,12 +398,26 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for testEnumParameters */ - private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEnumParameters + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); if (enumQueryStringArray != null) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java index b7119add7d1..aaf615a09ec 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java @@ -56,12 +56,19 @@ public class PetApi { this.apiClient = apiClient; } - /* Build call for addPet */ - private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for addPet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -170,13 +177,21 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deletePet */ - private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -290,12 +305,19 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for findPetsByStatus */ - private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); if (status != null) @@ -410,12 +432,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for findPetsByTags */ - private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); if (tags != null) @@ -530,13 +559,20 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getPetById */ - private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -649,12 +685,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for updatePet */ - private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -763,13 +806,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updatePetWithForm */ - private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePetWithForm + * @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 progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -888,13 +940,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for uploadFile */ - private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java index 199f2c7b109..0b9fc0c48c1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java @@ -54,13 +54,20 @@ public class StoreApi { this.apiClient = apiClient; } - /* Build call for deleteOrder */ - private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -169,12 +176,18 @@ public class StoreApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getInventory */ - private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getInventory + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; List localVarQueryParams = new ArrayList(); @@ -279,13 +292,20 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getOrderById */ - private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -398,12 +418,19 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for placeOrder */ - private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for placeOrder + * @param body order placed for purchasing the pet (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java index ea719996a6b..a0d51095ef0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java @@ -54,12 +54,19 @@ public class UserApi { this.apiClient = apiClient; } - /* Build call for createUser */ - private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUser + * @param body Created user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; List localVarQueryParams = new ArrayList(); @@ -168,12 +175,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithArrayInput */ - private com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithArrayInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; List localVarQueryParams = new ArrayList(); @@ -282,12 +296,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithListInput */ - private com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithListInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; List localVarQueryParams = new ArrayList(); @@ -396,13 +417,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deleteUser */ - private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -511,13 +539,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getUserByName */ - private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -630,12 +665,20 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for loginUser */ - private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; List localVarQueryParams = new ArrayList(); if (username != null) @@ -760,12 +803,18 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for logoutUser */ - private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for logoutUser + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; List localVarQueryParams = new ArrayList(); @@ -866,13 +915,21 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updateUser */ - private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 509edd69457..2bd4852e8ea 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesClass implements Parcelable { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -71,7 +71,7 @@ public class AdditionalPropertiesClass implements Parcelable { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java index df1255ab2ae..1fcb086e419 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java @@ -41,7 +41,7 @@ public class Animal implements Parcelable { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -59,7 +59,7 @@ public class Animal implements Parcelable { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f7b9740dd33..6c98580df10 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c5e8cf8dcda..faf67248e52 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly implements Parcelable { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java index 8b282c9796f..3e34712b7ea 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest implements Parcelable { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -74,7 +74,7 @@ public class ArrayTest implements Parcelable { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -97,7 +97,7 @@ public class ArrayTest implements Parcelable { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java index 446f7079cd5..f38325dda15 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java @@ -38,7 +38,7 @@ public class Cat extends Animal implements Parcelable { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java index 682da148ee7..f57160064d5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java @@ -40,7 +40,7 @@ public class Category implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Category implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java index fe409e10c0c..9c93c340da6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java @@ -37,7 +37,7 @@ public class Client implements Parcelable { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java index ab00719a026..8632408f529 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java @@ -38,7 +38,7 @@ public class Dog extends Animal implements Parcelable { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java index 965014b8ad9..8f0ed50d7cd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java @@ -86,7 +86,7 @@ public class EnumArrays implements Parcelable { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -109,7 +109,7 @@ public class EnumArrays implements Parcelable { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java index 84fd6e64938..b323d9d6913 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java @@ -116,7 +116,7 @@ public class EnumTest implements Parcelable { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -134,7 +134,7 @@ public class EnumTest implements Parcelable { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -152,7 +152,7 @@ public class EnumTest implements Parcelable { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -170,7 +170,7 @@ public class EnumTest implements Parcelable { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java index f4028c119a2..c7addcd279b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; import android.os.Parcelable; @@ -62,7 +63,7 @@ public class FormatTest implements Parcelable { private DateTime dateTime = null; @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("password") private String password = null; @@ -78,7 +79,7 @@ public class FormatTest implements Parcelable { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +99,7 @@ public class FormatTest implements Parcelable { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +117,7 @@ public class FormatTest implements Parcelable { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +137,7 @@ public class FormatTest implements Parcelable { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +157,7 @@ public class FormatTest implements Parcelable { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +177,7 @@ public class FormatTest implements Parcelable { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +195,7 @@ public class FormatTest implements Parcelable { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +213,7 @@ public class FormatTest implements Parcelable { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +231,7 @@ public class FormatTest implements Parcelable { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +249,7 @@ public class FormatTest implements Parcelable { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +267,7 @@ public class FormatTest implements Parcelable { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -275,7 +276,7 @@ public class FormatTest implements Parcelable { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -284,12 +285,12 @@ public class FormatTest implements Parcelable { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") - public String getUuid() { + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -302,7 +303,7 @@ public class FormatTest implements Parcelable { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } @@ -421,7 +422,7 @@ public class FormatTest implements Parcelable { binary = (byte[])in.readValue(null); date = (LocalDate)in.readValue(null); dateTime = (DateTime)in.readValue(null); - uuid = (String)in.readValue(null); + uuid = (UUID)in.readValue(null); password = (String)in.readValue(null); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index cc192a52704..4d59b539bef 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly implements Parcelable { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -44,7 +44,7 @@ public class HasOnlyReadOnly implements Parcelable { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java index 9c88e52a70c..eda550e267c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java @@ -70,7 +70,7 @@ public class MapTest implements Parcelable { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -93,7 +93,7 @@ public class MapTest implements Parcelable { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 39d61bbb34d..455c022291e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -21,6 +21,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; import android.os.Parcelable; import android.os.Parcel; @@ -31,7 +32,7 @@ import android.os.Parcel; public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("dateTime") private DateTime dateTime = null; @@ -39,7 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { @SerializedName("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -48,12 +49,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") - public String getUuid() { + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -66,7 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -89,7 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } @@ -157,7 +158,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { MixedPropertiesAndAdditionalPropertiesClass(Parcel in) { - uuid = (String)in.readValue(null); + uuid = (UUID)in.readValue(null); dateTime = (DateTime)in.readValue(null); map = (Map)in.readValue(Animal.class.getClassLoader()); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java index e02fe8ed623..528115eeb1d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java @@ -41,7 +41,7 @@ public class Model200Response implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Model200Response implements Parcelable { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java index cdd7d39842b..b97da392058 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -43,7 +43,7 @@ public class ModelApiResponse implements Parcelable { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -61,7 +61,7 @@ public class ModelApiResponse implements Parcelable { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -79,7 +79,7 @@ public class ModelApiResponse implements Parcelable { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java index 03e79de1cf3..e816e867cf7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java @@ -38,7 +38,7 @@ public class ModelReturn implements Parcelable { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java index 63368110a8a..20abe1d8777 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java @@ -47,7 +47,7 @@ public class Name implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -60,7 +60,7 @@ public class Name implements Parcelable { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -74,7 +74,7 @@ public class Name implements Parcelable { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -87,7 +87,7 @@ public class Name implements Parcelable { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java index 0ab9c71910a..9e3d066ffd3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java @@ -38,7 +38,7 @@ public class NumberOnly implements Parcelable { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java index 519edef7ed3..e1be656df7b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java @@ -78,7 +78,7 @@ public class Order implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -96,7 +96,7 @@ public class Order implements Parcelable { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -114,7 +114,7 @@ public class Order implements Parcelable { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -132,7 +132,7 @@ public class Order implements Parcelable { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -150,7 +150,7 @@ public class Order implements Parcelable { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -168,7 +168,7 @@ public class Order implements Parcelable { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java index f497bf3be4b..43c61fae2b3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java @@ -81,7 +81,7 @@ public class Pet implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -99,7 +99,7 @@ public class Pet implements Parcelable { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -140,7 +140,7 @@ public class Pet implements Parcelable { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -163,7 +163,7 @@ public class Pet implements Parcelable { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -181,7 +181,7 @@ public class Pet implements Parcelable { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 1b069d1bad5..fcbbcd73686 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -35,7 +35,7 @@ public class ReadOnlyFirst implements Parcelable { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -49,7 +49,7 @@ public class ReadOnlyFirst implements Parcelable { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java index 564a81ab3ff..1cc6a1395c8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -37,7 +37,7 @@ public class SpecialModelName implements Parcelable { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java index fe7f28b3c7b..51775132a73 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java @@ -40,7 +40,7 @@ public class Tag implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Tag implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java index eb4cf0a42d6..66576fba9d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java @@ -58,7 +58,7 @@ public class User implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -76,7 +76,7 @@ public class User implements Parcelable { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -94,7 +94,7 @@ public class User implements Parcelable { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -112,7 +112,7 @@ public class User implements Parcelable { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -130,7 +130,7 @@ public class User implements Parcelable { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -148,7 +148,7 @@ public class User implements Parcelable { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -166,7 +166,7 @@ public class User implements Parcelable { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -184,7 +184,7 @@ public class User implements Parcelable { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java index 8cebf9d6d31..81d39fcedba 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -57,8 +57,15 @@ public class FakeApi { this.apiClient = apiClient; } - /* Build call for testClientModel */ - private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClientModel + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -175,8 +182,28 @@ public class FakeApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for testEndpointParameters */ - private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEndpointParameters + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -371,8 +398,22 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for testEnumParameters */ - private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEnumParameters + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java index c428968e398..aaf615a09ec 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java @@ -56,8 +56,15 @@ public class PetApi { this.apiClient = apiClient; } - /* Build call for addPet */ - private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for addPet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -170,8 +177,16 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deletePet */ - private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -290,8 +305,15 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for findPetsByStatus */ - private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -410,8 +432,15 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for findPetsByTags */ - private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -530,8 +559,15 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getPetById */ - private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -649,8 +685,15 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for updatePet */ - private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -763,8 +806,17 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updatePetWithForm */ - private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePetWithForm + * @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 progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -888,8 +940,17 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for uploadFile */ - private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index f6027e22803..0b9fc0c48c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -54,8 +54,15 @@ public class StoreApi { this.apiClient = apiClient; } - /* Build call for deleteOrder */ - private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -169,8 +176,14 @@ public class StoreApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getInventory */ - private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getInventory + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -279,8 +292,15 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getOrderById */ - private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -398,8 +418,15 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for placeOrder */ - private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for placeOrder + * @param body order placed for purchasing the pet (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java index 1b2c0130d88..a0d51095ef0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java @@ -54,8 +54,15 @@ public class UserApi { this.apiClient = apiClient; } - /* Build call for createUser */ - private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUser + * @param body Created user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -168,8 +175,15 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithArrayInput */ - private com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithArrayInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -282,8 +296,15 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithListInput */ - private com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithListInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -396,8 +417,15 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deleteUser */ - private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -511,8 +539,15 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getUserByName */ - private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -630,8 +665,16 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for loginUser */ - private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -760,8 +803,14 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for logoutUser */ - private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for logoutUser + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -866,8 +915,16 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updateUser */ - private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables From 9d64e792a3f08e958ca1ed2e7c69557e4c512c22 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 00:52:10 +0800 Subject: [PATCH 125/132] add ivy2 to cache sbt install --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a2732b58b64..bc9f8dfc2e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ jdk: cache: directories: - $HOME/.m2 + - $HOME/.ivy2 - $HOME/samples/client/petstore/php/SwaggerClient-php/vendor - $HOME/samples/client/petstore/ruby/venodr/bundle - $HOME/samples/client/petstore/python/.venv/ From 63086130128bfc2a6fc8a9162cb7096f6aa15520 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 01:53:04 +0800 Subject: [PATCH 126/132] fix shippable config due to JAVA_HOME issue in openjdk8 (#5031) --- shippable.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shippable.yml b/shippable.yml index 97ed4286983..424e525a59b 100644 --- a/shippable.yml +++ b/shippable.yml @@ -2,7 +2,8 @@ language: java jdk: - openjdk7 -- openjdk8 + # comment out due to issue with JAVA_HOME + #- openjdk8 build: cache: true From 79e21d98c6902e10e42fb35b72e3d542345a9550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Mon, 13 Mar 2017 06:11:57 +0100 Subject: [PATCH 127/132] Fix wrong Docker Hub repo in README (#5033) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c2f4ba8c57..1417007641e 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ To generate code with this image, you'll need to mount a local location as a vol Example: ``` -docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen-cli generate \ +docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go From ba380c9ddaf2fb2dc81cd1a465389c9f6976bbfd Mon Sep 17 00:00:00 2001 From: Jeff Haynes Date: Mon, 13 Mar 2017 02:35:21 -0500 Subject: [PATCH 128/132] Issue 4759: Import complex type for body parameters (#4775) --- .../src/main/java/io/swagger/codegen/DefaultCodegen.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 463ded80774..8e9449bdfde 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2480,6 +2480,9 @@ public class DefaultCodegen { p.isPrimitiveType = cp.isPrimitiveType; p.isBinary = isDataTypeBinary(cp.datatype); p.isFile = isDataTypeFile(cp.datatype); + if (cp.complexType != null) { + imports.add(cp.complexType); + } } // set boolean flag (e.g. isString) From 722bbb8e1f6afc3f5185fdcf09be2bcb5adaf893 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 19:43:09 +0800 Subject: [PATCH 129/132] update clojure test cases after restoring to petstore.json (#5043) --- .../clojure/src/swagger_petstore/api/pet.clj | 63 +------------------ .../src/swagger_petstore/api/store.clj | 45 +------------ .../clojure/src/swagger_petstore/api/user.clj | 1 + .../clojure/src/swagger_petstore/core.clj | 12 +--- .../test/swagger_petstore/core_test.clj | 12 +--- 5 files changed, 10 insertions(+), 123 deletions(-) diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj index 96c1cf85fc2..845aa55b526 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj @@ -24,28 +24,6 @@ ([optional-params] (:data (add-pet-with-http-info optional-params)))) -(defn add-pet-using-byte-array-with-http-info - "Fake endpoint to test byte array in body parameter for adding a new pet to the store - " - ([] (add-pet-using-byte-array-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/pet?testing_byte_array=true" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types ["application/json" "application/xml"] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) - -(defn add-pet-using-byte-array - "Fake endpoint to test byte array in body parameter for adding a new pet to the store - " - ([] (add-pet-using-byte-array nil)) - ([optional-params] - (:data (add-pet-using-byte-array-with-http-info optional-params)))) - (defn delete-pet-with-http-info "Deletes a pet " @@ -120,7 +98,7 @@ :form-params {} :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) + :auth-names ["petstore_auth" "api_key"]})) (defn get-pet-by-id "Find pet by ID @@ -128,44 +106,6 @@ [pet-id ] (:data (get-pet-by-id-with-http-info pet-id))) -(defn get-pet-by-id-in-object-with-http-info - "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" - [pet-id ] - (call-api "/pet/{petId}?response=inline_arbitrary_object" :get - {:path-params {"petId" pet-id } - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) - -(defn get-pet-by-id-in-object - "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" - [pet-id ] - (:data (get-pet-by-id-in-object-with-http-info pet-id))) - -(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info - "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" - [pet-id ] - (call-api "/pet/{petId}?testing_byte_array=true" :get - {:path-params {"petId" pet-id } - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) - -(defn pet-pet-idtesting-byte-arraytrue-get - "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" - [pet-id ] - (:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id))) - (defn update-pet-with-http-info "Update an existing pet " @@ -229,3 +169,4 @@ ([pet-id ] (upload-file pet-id nil)) ([pet-id optional-params] (:data (upload-file-with-http-info pet-id optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj index 1e3cc25e4a6..04d185a8086 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj @@ -21,27 +21,6 @@ [order-id ] (:data (delete-order-with-http-info order-id))) -(defn find-orders-by-status-with-http-info - "Finds orders by status - A single status value can be provided as a string" - ([] (find-orders-by-status-with-http-info nil)) - ([{:keys [status ]}] - (call-api "/store/findByStatus" :get - {:path-params {} - :header-params {} - :query-params {"status" status } - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["test_api_client_id" "test_api_client_secret"]}))) - -(defn find-orders-by-status - "Finds orders by status - A single status value can be provided as a string" - ([] (find-orders-by-status nil)) - ([optional-params] - (:data (find-orders-by-status-with-http-info optional-params)))) - (defn get-inventory-with-http-info "Returns pet inventories by status Returns a map of status codes to quantities" @@ -61,25 +40,6 @@ [] (:data (get-inventory-with-http-info))) -(defn get-inventory-in-object-with-http-info - "Fake endpoint to test arbitrary object return by 'Get inventory' - Returns an arbitrary object which is actually a map of status codes to quantities" - [] - (call-api "/store/inventory?response=arbitrary_object" :get - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key"]})) - -(defn get-inventory-in-object - "Fake endpoint to test arbitrary object return by 'Get inventory' - Returns an arbitrary object which is actually a map of status codes to quantities" - [] - (:data (get-inventory-in-object-with-http-info))) - (defn get-order-by-id-with-http-info "Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" @@ -91,7 +51,7 @@ :form-params {} :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["test_api_key_header" "test_api_key_query"]})) + :auth-names []})) (defn get-order-by-id "Find purchase order by ID @@ -112,7 +72,7 @@ :body-param body :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["test_api_client_id" "test_api_client_secret"]}))) + :auth-names []}))) (defn place-order "Place an order for a pet @@ -120,3 +80,4 @@ ([] (place-order nil)) ([optional-params] (:data (place-order-with-http-info optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj index 07b016d641a..26e3dffc624 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj @@ -167,3 +167,4 @@ ([username ] (update-user username nil)) ([username optional-params] (:data (update-user-with-http-info username optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/core.clj b/samples/client/petstore/clojure/src/swagger_petstore/core.clj index f01f3061e0d..20c31bb9a71 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/core.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/core.clj @@ -8,11 +8,7 @@ (java.text SimpleDateFormat))) (def auth-definitions - {"test_api_key_header" {:type :api-key :in :header :param-name "test_api_key_header"} - "api_key" {:type :api-key :in :header :param-name "api_key"} - "test_api_client_secret" {:type :api-key :in :header :param-name "x-test_api_client_secret"} - "test_api_client_id" {:type :api-key :in :header :param-name "x-test_api_client_id"} - "test_api_key_query" {:type :api-key :in :query :param-name "test_api_key_query"} + {"api_key" {:type :api-key :in :header :param-name "api_key"} "petstore_auth" {:type :oauth2}}) (def default-api-context @@ -21,11 +17,7 @@ :date-format "yyyy-MM-dd" :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false - :auths {"test_api_key_header" nil - "api_key" nil - "test_api_client_secret" nil - "test_api_client_id" nil - "test_api_key_query" nil + :auths {"api_key" nil "petstore_auth" nil}}) (def ^:dynamic *api-context* diff --git a/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj b/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj index 220afbf9d62..9c50a3d1af6 100644 --- a/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj +++ b/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj @@ -11,11 +11,7 @@ :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false :auths {"api_key" nil - "petstore_auth" nil - "test_api_client_id" nil - "test_api_client_secret" nil - "test_api_key_query" nil - "test_api_key_header" nil}} + "petstore_auth" nil}} default-api-context *api-context* (with-api-context {} @@ -50,11 +46,7 @@ :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false :auths {"api_key" nil - "petstore_auth" nil - "test_api_client_id" nil - "test_api_client_secret" nil - "test_api_key_query" nil - "test_api_key_header" nil}} + "petstore_auth" nil}} default-api-context *api-context*)))) From a2d1edc6f5d4115a9eed29e71a63251c1ef0bfd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Mon, 13 Mar 2017 14:46:28 +0100 Subject: [PATCH 130/132] Fix (partially) #4898 for groovy (#5030) * Fix (partially) #4898 for groovy. This also adds some TODOs for the missing path, form and body parameters. * Update Groovy samples (after partial fix for #4898) --- .../src/main/resources/Groovy/api.mustache | 8 +++-- .../main/groovy/io/swagger/api/PetApi.groovy | 34 ++++++++++++++----- .../groovy/io/swagger/api/StoreApi.groovy | 16 ++++++--- .../main/groovy/io/swagger/api/UserApi.groovy | 32 ++++++++++++----- 4 files changed, 66 insertions(+), 24 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache index c952718b6ec..9f82181d45e 100644 --- a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache @@ -18,7 +18,7 @@ class {{classname}} { {{#operation}} def {{operationId}} ({{#allParams}} {{{dataType}}} {{paramName}},{{/allParams}} Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "{{path}}" // query params @@ -35,13 +35,15 @@ class {{classname}} { {{/allParams}} {{#queryParams}}if (!"null".equals(String.valueOf({{paramName}}))) - queryParams.put("{{paramName}}", String.valueOf({{paramName}})) + queryParams.put("{{baseName}}", String.valueOf({{paramName}})) {{/queryParams}} {{#headerParams}} - headerParams.put("{{paramName}}", {{paramName}}) + headerParams.put("{{baseName}}", {{paramName}}) {{/headerParams}} + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "{{httpMethod}}", "{{returnContainer}}", {{#returnBaseType}}{{{returnBaseType}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy index b1b43f81559..a223f4bbadb 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy @@ -17,7 +17,7 @@ class PetApi { String versionPath = "/api/v1" def addPet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet" // query params @@ -31,13 +31,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def deletePet ( Long petId, String apiKey, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -50,7 +52,9 @@ class PetApi { } - headerParams.put("apiKey", apiKey) + headerParams.put("api_key", apiKey) + + // Also still TODO: form params, body param invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", @@ -58,7 +62,7 @@ class PetApi { } def findPetsByStatus ( List status, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/findByStatus" // query params @@ -74,13 +78,15 @@ class PetApi { queryParams.put("status", String.valueOf(status)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "array", Pet.class ) } def findPetsByTags ( List tags, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/findByTags" // query params @@ -96,13 +102,15 @@ class PetApi { queryParams.put("tags", String.valueOf(tags)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "array", Pet.class ) } def getPetById ( Long petId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -116,13 +124,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", Pet.class ) } def updatePet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet" // query params @@ -136,13 +146,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "PUT", "", null ) } def updatePetWithForm ( Long petId, String name, String status, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -156,13 +168,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def uploadFile ( Long petId, String additionalMetadata, File file, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}/uploadImage" // query params @@ -176,6 +190,8 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", ModelApiResponse.class ) diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy index 51047b4834b..bf74dd21266 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy @@ -16,7 +16,7 @@ class StoreApi { String versionPath = "/api/v1" def deleteOrder ( String orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order/{orderId}" // query params @@ -30,13 +30,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", null ) } def getInventory ( Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/inventory" // query params @@ -46,13 +48,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "map", Map.class ) } def getOrderById ( Long orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order/{orderId}" // query params @@ -66,13 +70,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", Order.class ) } def placeOrder ( Order body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order" // query params @@ -86,6 +92,8 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", Order.class ) diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy index 5a8a4b2eea8..411fc55ae86 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy @@ -15,7 +15,7 @@ class UserApi { String versionPath = "/api/v1" def createUser ( User body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user" // query params @@ -29,13 +29,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def createUsersWithArrayInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/createWithArray" // query params @@ -49,13 +51,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def createUsersWithListInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/createWithList" // query params @@ -69,13 +73,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def deleteUser ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -89,13 +95,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", null ) } def getUserByName ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -109,13 +117,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", User.class ) } def loginUser ( String username, String password, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/login" // query params @@ -137,13 +147,15 @@ if (!"null".equals(String.valueOf(password))) queryParams.put("password", String.valueOf(password)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", String.class ) } def logoutUser ( Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/logout" // query params @@ -153,13 +165,15 @@ if (!"null".equals(String.valueOf(password))) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", null ) } def updateUser ( String username, User body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -177,6 +191,8 @@ if (!"null".equals(String.valueOf(password))) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "PUT", "", null ) From ebfc39e435c6a5a961806f78d4a8758b2c911b09 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 22:05:36 +0800 Subject: [PATCH 131/132] use oracle jdk instead in shippable config (#5045) --- shippable.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shippable.yml b/shippable.yml index 424e525a59b..0d4df63c067 100644 --- a/shippable.yml +++ b/shippable.yml @@ -1,9 +1,8 @@ language: java jdk: +- oraclejdk8 - openjdk7 - # comment out due to issue with JAVA_HOME - #- openjdk8 build: cache: true From 9b281b218061e168bf737d31094c3c03890077ca Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 13 Mar 2017 22:06:45 +0800 Subject: [PATCH 132/132] make bin/java-play-framework-petstore-server.sh executable --- bin/java-play-framework-petstore-server.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/java-play-framework-petstore-server.sh diff --git a/bin/java-play-framework-petstore-server.sh b/bin/java-play-framework-petstore-server.sh old mode 100644 new mode 100755