From 909f39274576d6162cb4367a46b27abfcc37609f Mon Sep 17 00:00:00 2001 From: JC Casas Date: Fri, 31 Mar 2017 03:30:40 -0500 Subject: [PATCH 01/13] fix mustache file for build.bat (#5264) replace IO.Swagger for {{packageName}} where necessary --- .../swagger-codegen/src/main/resources/csharp/compile.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache index 8d9f9bf344e..2ecdbadc8b0 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache @@ -22,5 +22,5 @@ copy packages\Fody.1.29.2\Fody.dll bin\Fody.dll copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll {{/generatePropertyChanged}} -%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml From 5c3fe23e9f558f3337676125eb5a17532315d397 Mon Sep 17 00:00:00 2001 From: Benjamin Douglas Date: Sat, 1 Apr 2017 00:33:20 -0700 Subject: [PATCH 02/13] Support Swagger collectionFormat encodings in Feign (#5266) * Support Swagger collectionFormat encodings in Feign Feign only natively supports the "multi" collectionFormat for encoding lists of parameter values. This change adds manual encoding of the other formats, such as "csv" (the default for collections), "tsv", space-separated, and pipes. * Fix typo in anchor tag. --- .../codegen/languages/JavaClientCodegen.java | 1 + .../libraries/feign/EncodingUtils.mustache | 86 +++++++++++++++++++ .../Java/libraries/feign/api.mustache | 10 ++- .../Java/libraries/feign/pom.mustache | 12 +++ samples/client/petstore/java/feign/pom.xml | 12 +++ .../java/io/swagger/client/EncodingUtils.java | 86 +++++++++++++++++++ .../java/io/swagger/client/api/FakeApi.java | 9 +- .../java/io/swagger/client/api/PetApi.java | 9 +- .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 7 +- .../io/swagger/client/api/PetApiTest.java | 22 +++++ 11 files changed, 242 insertions(+), 13 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache create mode 100644 samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.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 3b8cea940a1..acfd7d78469 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 @@ -176,6 +176,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen if ("feign".equals(getLibrary())) { additionalProperties.put("jackson", "true"); supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); + supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); } else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache new file mode 100644 index 00000000000..6f43e1c3c2a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache @@ -0,0 +1,86 @@ +package {{invokerPackage}}; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** +* Utilities to support Swagger encoding formats in Feign. +*/ +public final class EncodingUtils { + + /** + * Private constructor. Do not construct this class. + */ + private EncodingUtils() {} + + /** + *

Encodes a collection of query parameters according to the Swagger + * collection format.

+ * + *

Of the various collection formats defined by Swagger ("csv", "tsv", + * etc), Feign only natively supports "multi". This utility generates the + * other format types so it will be properly processed by Feign.

+ * + *

Note, as part of reformatting, it URL encodes the parameters as + * well.

+ * @param parameters The collection object to be formatted. This object will + * not be changed. + * @param collectionFormat The Swagger collection format (eg, "csv", "tsv", + * "pipes"). See the + * + * Swagger Spec for more details. + * @return An object that will be correctly formatted by Feign. + */ + public static Object encodeCollection(Collection parameters, + String collectionFormat) { + if (parameters == null) { + return parameters; + } + List stringValues = new ArrayList<>(parameters.size()); + for (Object parameter : parameters) { + // ignore null values (same behavior as Feign) + if (parameter != null) { + stringValues.add(encode(parameter)); + } + } + // Feign natively handles single-element lists and the "multi" format. + if (stringValues.size() < 2 || "multi".equals(collectionFormat)) { + return stringValues; + } + // Otherwise return a formatted String + String[] stringArray = stringValues.toArray(new String[0]); + switch (collectionFormat) { + case "csv": + default: + return StringUtil.join(stringArray, ","); + case "ssv": + return StringUtil.join(stringArray, " "); + case "tsv": + return StringUtil.join(stringArray, "\t"); + case "pipes": + return StringUtil.join(stringArray, "|"); + } + } + + /** + * URL encode a single query parameter. + * @param parameter The query parameter to encode. This object will not be + * changed. + * @return The URL encoded string representation of the parameter. If the + * parameter is null, returns null. + */ + public static String encode(Object parameter) { + if (parameter == null) { + return null; + } + try { + return URLEncoder.encode(parameter.toString(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache index 6aadf2305d1..67a772a8772 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache @@ -1,6 +1,7 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.EncodingUtils; {{#legacyDates}} import {{invokerPackage}}.ParamExpander; {{/legacyDates}} @@ -71,7 +72,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}}, {{/hasMore}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap Map queryParams); + {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -80,7 +81,12 @@ public interface {{classname}} extends ApiClient.Api { public static class {{operationIdCamelCase}}QueryParams extends HashMap { {{#queryParams}} public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) { - put("{{baseName}}", value); + {{#collectionFormat}} + put("{{baseName}}", EncodingUtils.encodeCollection(value, "{{collectionFormat}}")); + {{/collectionFormat}} + {{^collectionFormat}} + put("{{baseName}}", EncodingUtils.encode(value)); + {{/collectionFormat}} return this; } {{/queryParams}} 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 da5eb7f93ab..7c05b94ca3e 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 @@ -230,6 +230,18 @@ ${junit-version} test + + com.squareup.okhttp3 + mockwebserver + 3.6.0 + test + + + org.assertj + assertj-core + 1.7.1 + test + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 37d2b96f4fa..afc858fcab8 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -230,6 +230,18 @@ ${junit-version} test + + com.squareup.okhttp3 + mockwebserver + 3.6.0 + test + + + org.assertj + assertj-core + 1.7.1 + test + 1.7 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java new file mode 100644 index 00000000000..c474fc62187 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java @@ -0,0 +1,86 @@ +package io.swagger.client; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** +* Utilities to support Swagger encoding formats in Feign. +*/ +public final class EncodingUtils { + + /** + * Private constructor. Do not construct this class. + */ + private EncodingUtils() {} + + /** + *

Encodes a collection of query parameters according to the Swagger + * collection format.

+ * + *

Of the various collection formats defined by Swagger ("csv", "tsv", + * etc), Feign only natively supports "multi". This utility generates the + * other format types so it will be properly processed by Feign.

+ * + *

Note, as part of reformatting, it URL encodes the parameters as + * well.

+ * @param parameters The collection object to be formatted. This object will + * not be changed. + * @param collectionFormat The Swagger collection format (eg, "csv", "tsv", + * "pipes"). See the + * + * Swagger Spec for more details. + * @return An object that will be correctly formatted by Feign. + */ + public static Object encodeCollection(Collection parameters, + String collectionFormat) { + if (parameters == null) { + return parameters; + } + List stringValues = new ArrayList<>(parameters.size()); + for (Object parameter : parameters) { + // ignore null values (same behavior as Feign) + if (parameter != null) { + stringValues.add(encode(parameter)); + } + } + // Feign natively handles single-element lists and the "multi" format. + if (stringValues.size() < 2 || "multi".equals(collectionFormat)) { + return stringValues; + } + // Otherwise return a formatted String + String[] stringArray = stringValues.toArray(new String[0]); + switch (collectionFormat) { + case "csv": + default: + return StringUtil.join(stringArray, ","); + case "ssv": + return StringUtil.join(stringArray, " "); + case "tsv": + return StringUtil.join(stringArray, "\t"); + case "pipes": + return StringUtil.join(stringArray, "|"); + } + } + + /** + * URL encode a single query parameter. + * @param parameter The query parameter to encode. This object will not be + * changed. + * @return The URL encoded string representation of the parameter. If the + * parameter is null, returns null. + */ + public static String encode(Object parameter) { + if (parameter == null) { + return null; + } + try { + return URLEncoder.encode(parameter.toString(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } +} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index ab0b9b2bd4f..77c7ae592b2 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import java.math.BigDecimal; import io.swagger.client.model.Client; @@ -106,7 +107,7 @@ public interface FakeApi extends ApiClient.Api { "enum_header_string: {enumHeaderString}" }) - void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap Map queryParams); + void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -114,15 +115,15 @@ public interface FakeApi extends ApiClient.Api { */ public static class TestEnumParametersQueryParams extends HashMap { public TestEnumParametersQueryParams enumQueryStringArray(final List value) { - put("enum_query_string_array", value); + put("enum_query_string_array", EncodingUtils.encodeCollection(value, "csv")); return this; } public TestEnumParametersQueryParams enumQueryString(final String value) { - put("enum_query_string", value); + put("enum_query_string", EncodingUtils.encode(value)); return this; } public TestEnumParametersQueryParams enumQueryInteger(final Integer value) { - put("enum_query_integer", value); + put("enum_query_integer", EncodingUtils.encode(value)); return this; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 48987c67f38..5a6813c6198 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -75,7 +76,7 @@ public interface PetApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - List findPetsByStatus(@QueryMap Map queryParams); + List findPetsByStatus(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -83,7 +84,7 @@ public interface PetApi extends ApiClient.Api { */ public static class FindPetsByStatusQueryParams extends HashMap { public FindPetsByStatusQueryParams status(final List value) { - put("status", value); + put("status", EncodingUtils.encodeCollection(value, "csv")); return this; } } @@ -121,7 +122,7 @@ public interface PetApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - List findPetsByTags(@QueryMap Map queryParams); + List findPetsByTags(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -129,7 +130,7 @@ public interface PetApi extends ApiClient.Api { */ public static class FindPetsByTagsQueryParams extends HashMap { public FindPetsByTagsQueryParams tags(final List value) { - put("tags", value); + put("tags", EncodingUtils.encodeCollection(value, "csv")); return this; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 9e1ecddbece..1ad8111d3d6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import io.swagger.client.model.Order; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index c271b9deda8..e85fca41f8b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import io.swagger.client.model.User; @@ -110,7 +111,7 @@ public interface UserApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - String loginUser(@QueryMap Map queryParams); + String loginUser(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -118,11 +119,11 @@ public interface UserApi extends ApiClient.Api { */ public static class LoginUserQueryParams extends HashMap { public LoginUserQueryParams username(final String value) { - put("username", value); + put("username", EncodingUtils.encode(value)); return this; } public LoginUserQueryParams password(final String value) { - put("password", value); + put("password", EncodingUtils.encode(value)); return this; } } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java index b144cde9ff0..8bf44c41cb5 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java @@ -13,17 +13,25 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; import org.junit.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.*; public class PetApiTest { ApiClient apiClient; PetApi api; + MockWebServer localServer; + ApiClient localClient; @Before public void setup() { apiClient = new ApiClient(); api = apiClient.buildClient(PetApi.class); + localServer = new MockWebServer(); + localClient = new ApiClient(); } @Test @@ -211,6 +219,20 @@ public class PetApiTest { assertTrue(pet1.hashCode() == pet1.hashCode()); } + @Test + public void testCSVDelimitedArray() throws Exception { + localServer.enqueue(new MockResponse().setBody("[{\"id\":5,\"name\":\"rocky\"}]")); + localServer.start(); + PetApi api = localClient.setBasePath(localServer.url("/").toString()).buildClient(PetApi.class); + PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() + .tags(Arrays.asList("friendly","energetic")); + List pets = api.findPetsByTags(queryParams); + assertNotNull(pets); + RecordedRequest request = localServer.takeRequest(); + assertThat(request.getPath()).contains("tags=friendly,energetic"); + localServer.shutdown(); + } + private Pet createRandomPet() { Pet pet = new Pet(); pet.setId(TestUtils.nextId()); From 5de19e3214325957272d5f3255cf13b1ced1425d Mon Sep 17 00:00:00 2001 From: Griffin Schneider Date: Sat, 1 Apr 2017 04:06:31 -0400 Subject: [PATCH 03/13] [Swift3] Fix bug where non-camel-case path params didn't work. (#5267) * [Swift3] Fix bug where non-camel-case path params didn't work. * [Swift3] Fix bug where int enums generated non-compiling code. Swift3 integration tests now pass. * [Swift3] Add a non-camel-case path parameter to petstore-with-fake-endpoints-models-for-testing. This would have caused the Swift3 tests to be broken before 7387e49fef56a624045aa52b65ffb9c19b3853ec. --- .../codegen/languages/Swift3Codegen.java | 35 - .../src/main/resources/swift3/_param.mustache | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 6 +- .../Classes/Swaggers/APIs/FakeAPI.swift | 2 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 4 +- .../default/SwaggerClientTests/Podfile.lock | 2 +- .../PetstoreClient.podspec.json | 2 +- .../SwaggerClientTests/Pods/Manifest.lock | 2 +- .../Pods/Pods.xcodeproj/project.pbxproj | 972 +++++++++--------- ...ds-SwaggerClient-acknowledgements.markdown | 228 ---- .../Pods-SwaggerClient-acknowledgements.plist | 236 ----- .../Classes/Swaggers/APIs/FakeAPI.swift | 2 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 4 +- .../Classes/Swaggers/APIs/FakeAPI.swift | 2 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 4 +- 15 files changed, 513 insertions(+), 990 deletions(-) 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 6a2ccf176a1..9d0baf72d10 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 @@ -46,7 +46,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { protected boolean swiftUseApiNamespace; protected String[] responseAs = new String[0]; protected String sourceFolder = "Classes" + File.separator + "Swaggers"; - private static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z_]+\\}"); @Override public CodegenType getTag() { @@ -455,40 +454,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { return codegenModel; } - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, Swagger swagger) { - path = normalizePath(path); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - // issue 3914 - removed logic designed to remove any parameter of type HeaderParameter - return super.fromOperation(path, httpMethod, operation, definitions, swagger); - } - - private static String normalizePath(String path) { - StringBuilder builder = new StringBuilder(); - - int cursor = 0; - Matcher matcher = PATH_PARAM_PATTERN.matcher(path); - boolean found = matcher.find(); - while (found) { - String stringBeforeMatch = path.substring(cursor, matcher.start()); - builder.append(stringBeforeMatch); - - String group = matcher.group().substring(1, matcher.group().length() - 1); - group = camelize(group, true); - builder - .append("{") - .append(group) - .append("}"); - - cursor = matcher.end(); - found = matcher.find(); - } - - String stringAfterMatch = path.substring(cursor); - builder.append(stringAfterMatch); - - return builder.toString(); - } - public void setProjectName(String projectName) { this.projectName = projectName; } diff --git a/modules/swagger-codegen/src/main/resources/swift3/_param.mustache b/modules/swagger-codegen/src/main/resources/swift3/_param.mustache index 6d2de20a655..5caacbc6005 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/_param.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/_param.mustache @@ -1 +1 @@ -"{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} \ No newline at end of file +"{{baseName}}": {{paramName}}{{^isEnum}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{/isEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index d55068f432d..55056c20330 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -324,7 +324,7 @@ paths: $ref: '#/definitions/Order' '400': description: Invalid Order - '/store/order/{orderId}': + '/store/order/{order_id}': get: tags: - store @@ -335,7 +335,7 @@ paths: - application/xml - application/json parameters: - - name: orderId + - name: order_id in: path description: ID of pet that needs to be fetched required: true @@ -362,7 +362,7 @@ paths: - application/xml - application/json parameters: - - name: orderId + - name: order_id in: path description: ID of the order that needs to be deleted required: true diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 302d08d5a92..51e54c5af34 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -249,7 +249,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ 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 39255660b56..faa408a2141 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 @@ -34,7 +34,7 @@ open class StoreAPI: APIBase { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -138,7 +138,7 @@ open class StoreAPI: APIBase { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock index e7c0cf8d523..e10791b3c96 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock @@ -12,7 +12,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: fef59f00388f267e52d9b432aa5d93dc97190f14 - PetstoreClient: bbde3383c51466fdda24ec28153ce2847ae5456f + PetstoreClient: 0f65d85b2a09becd32938348b3783a9394a07346 PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index 25f56a796b8..b8acea6409f 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -10,7 +10,7 @@ "tag": "v1.0.0" }, "authors": "", - "license": "Apache License, Version 2.0", + "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock index e7c0cf8d523..e10791b3c96 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock @@ -12,7 +12,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: fef59f00388f267e52d9b432aa5d93dc97190f14 - PetstoreClient: bbde3383c51466fdda24ec28153ce2847ae5456f + PetstoreClient: 0f65d85b2a09becd32938348b3783a9394a07346 PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index dae5a7adb2c..e154f2cb91c 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,228 +7,236 @@ objects = { /* Begin PBXBuildFile section */ - 03EE41C7303FF17FFB50AC1365929CF7 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9B2737214A9FBDFAFE4EFE2C5622B27 /* ReadOnlyFirst.swift */; }; - 06C3C2F3A8B5B1D1AAC0D29ECC8B5970 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F28DB75084895EF23EDBC499D8B8BAE /* Cat.swift */; }; - 0C1B4E9FFB8B81E8833A3BAD537B1990 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - 0D420ED1DD1A8E1BF24FC85ABB82D669 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31C953CB2AF9E4E3D884BBA68E728307 /* Model200Response.swift */; }; - 12118C354EFA36292F82A8D0CFCE45B2 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; - 13F7C9AF056DF8BA92AB2BAF217D8D04 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E47D71F3FB3E8B7FBEA178972FB52D /* Category.swift */; }; - 1AD5AD2C098CCCC2B6F7214BF604CB9B /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 540B42E772FF76C6D4F5E68CCDADA9B3 /* ArrayOfArrayOfNumberOnly.swift */; }; - 1C5DDB3A511B358ECC2B4BAE060ED9FC /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC23A659B67F5C77068CA536C88CA9D0 /* PetAPI.swift */; }; - 1E4C6B6A8D716620DE786BBF7DEAD993 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1FB3F9E6B2DC47002778D605F14939D6 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E90BC12F77D66B96AB27E026B2071E /* NumberOnly.swift */; }; - 33A38B024F2FAF97CD18BE77E1B59AC6 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6097AF9273FDB02C8A4DED04AFF6B4AD /* AnimalFarm.swift */; }; - 37E67199CFA606106C726BA6CFC0B4D3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E73416EE991BBE43467BA22F2A155A5 /* Models.swift */; }; - 3982B850C43B41BA6D25F440F0412E9B /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; - 3CA0C61EB5AA01268C12B7E61FF59C56 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; }; - 426B7FD8E61D930DE16BAC12FB726CE2 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C79F2ABDEC68FB086941B1667F653AC /* Name.swift */; }; - 434EA46C36A82495415C5311DE52DEE6 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42105B8EAB28DFBC1FD088D5D8C08610 /* EnumTest.swift */; }; - 4CEA56A149345E34DBFB8F26836ADA7D /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B50A816814713052A83AD22ECB8E19D /* Animal.swift */; }; - 588EFA41BF51F86A0ACA00AE2129D24E /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCFC11EBD20C97FB1BC4EFAEC6FEB37 /* EnumArrays.swift */; }; - 5E25A9DF7FE0293488B24739844CFA4E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1E790656723DC52EAB91FF86121D3D /* Return.swift */; }; - 5FD117885B2A8748C851D3BEF7EEEF06 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC8DF8745F891F2A12590D73550D0490 /* HasOnlyReadOnly.swift */; }; - 62143065F94E53F437DCE5D7A998D66D /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; - 6BE7B6EE63646366DD00EC3C286B2315 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; - 6C0889CCE8E1D85E698D8EC564C4853E /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CE09CBDF55D26A9D95DD15E7DEA056 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 70C02206CAF9D7E01C51B4529C8AD123 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21B120C00973CD2A57F3D566E760AF3E /* ArrayTest.swift */; }; - 736ABF80511158678C6068F0EA6C4F5E /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 143E557A35666A5C3FB6A5EC601425AE /* Tag.swift */; }; - 7CA5A9BA5246FDA8227233E310029392 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; - 8146DC6C21BC6B7D6E9F1C614BC1B9C2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3FF8700849757249B929D7AFF652CD6 /* Extensions.swift */; }; - 816BE1BBC1F4E434D7BD3F793F38B347 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86ED08F33B7D357932A9AB743E9D9EA7 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - 897283A0B7F5299913327CC8FD6CC997 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8D463A0A4C65C02FDD5211F0F3C6F8B8 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; - 8FFF3001784D9A7F0C499B533D71DD4C /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E9F0D4DC6F738F2ECF8D716B7A9A5C7 /* APIs.swift */; }; - 907AB123FBC8BC9340D5B7350CE828DF /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; - 91C09AC2A52ED69A27C8D923139A006F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; }; - 925D027E2FCA75AB2B2F2195EB14AFBB /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - 9460E7ECF6325A1C9EED36372DBC3D6D /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = E906A19EC726985BD8493A893CA9DD65 /* FakeAPI.swift */; }; - 9469DF81ECB494E84675969B5E13374C /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9FC9759E7BA02FF67AE579C8A0043D96 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 118386CB29E583E2BCF45FFB0C584C22 /* UserAPI.swift */; }; - A37E7B4926057F8DC36D5EF5E17CE722 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2364F4EAC509113B38791789DFC9F1E7 /* Order.swift */; }; - A3B4B8D0EC2ED8909876E2CB361AF87F /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7FD39D7BA8415D865896B06564C124 /* List.swift */; }; - A69008B3AAFE217515CAC19EC2BBB8D5 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9928726B622806E400277C57963B354B /* Client.swift */; }; - A79AC30123B0C2177D67F6ED6A1B3215 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; - AF158CAAF4DD319009AFC855DC995D90 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; - B656F729908BDC89686840DB4797E41E /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1300E3C28C82031FA5C87A7FE3B1EB9 /* Pet.swift */; }; - B8154C96802336E5DDA5CEE97C3180A0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; - BAB7DEE435F7E246160AF61B1A52613D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2E15D74AD528E3350D207603BBA1DF4 /* StoreAPI.swift */; }; - BB42BBFB6683977C7DC25EC32D9EAA72 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11A9D1B03B658EFF2011FD4ADF5B2C9B /* FormatTest.swift */; }; - BDD68D9A8AFC895FE449F76B45BB7635 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73F00E8ED2521B115946B7E20B760AF /* APIHelper.swift */; }; - C0AEA97E7684DDAD56998C0AE198A433 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; - C546890220177F840E8AFC829D0E3FEB /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - C7A3408350643ADE1018826C766EE356 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; - C8592AD030234E841A61CA09ED02059A /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - C99577B805EB3E6EDCDA06D0E6253B41 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F939073B0FDC62477A0C4F8E9AB7131 /* SpecialModelName.swift */; }; - D0BA8173A676167CAC2973A79BD0242E /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6292ECC342913CF10F15F320C0D10143 /* AlamofireImplementations.swift */; }; - D4EA06289110B4F5DC19DDDE8831FF5F /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F328163C591BBCCD1909AFA5B31CE95A /* AdditionalPropertiesClass.swift */; }; - D5E6B1E3BD16CF981E24E74371C95A8F /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB8DD3379CB8E9DB0DC9E6B18356204 /* Dog.swift */; }; - DF1BBF94997A2F4248B42B25EA919EC2 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - E1F583CB4A68A928CD197250AA752926 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; - E2A1C34237B4E928E5F85C097F4C2551 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; - E59BF19C0AFA68B741552319FC478C7B /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; - E9722CFC027D91761F36943C8EF0737C /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBAF179E866C1F42E3C9F85162E2792 /* ArrayOfNumberOnly.swift */; }; - EB28CEEA7D16626E36446A03BDA3B99B /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4CA6814AE828DFEC4A4C2C8C1D6CEA2 /* ApiResponse.swift */; }; - EEBF1A088C53B7CA163809C3753C524D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; }; - F206C370F63155D3468E0C188498C5DC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; }; - F96E0891F2AE26D2CA24BD31378328A9 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8180325E22D8580EFE2473A67C0EAC0 /* User.swift */; }; - FC37FC0FD78A4BF0BBA8E7B1FE56D473 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFF589887A9AAE06637E527EC61117B0 /* MapTest.swift */; }; - FE1EAE93BA87614AA129DE8223AA5B7A /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6115C108A2F1445CCA165DCE5321009 /* EnumClass.swift */; }; - FFFDD494EE6D1B83DDAF5F2721F685A6 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; + 08C43F202E7FC3E8F2730CCB9FBD7998 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F1532A628EE993828CBA58896E7077 /* Animal.swift */; }; + 0BD2D76CD41573EC2B53977627E0D5BB /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */; }; + 101544113D88337D6D76FC4B35796A04 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */; }; + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; + 14173079C167B121B3165D371B1025B0 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */; }; + 1627426CA13781AE27C0FC0C98F6A88D /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */; }; + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 218599F3A5EF5064545F1C63CD2014ED /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */; }; + 250F58C891252EFD0C30E681503B370A /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */; }; + 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 349A70A41286448022F4219D4FDE0678 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; + 39F639E647EE2C7BBBE1D600D5460A09 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */; }; + 3A93D7E1111888C47B0138AE97A5012A /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */; }; + 3E2E6328563E0FA71FE88D30BC1736D7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */; }; + 40B3F80E1C272838FA43C7C60D600B13 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */; }; + 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4A61D9C5338D311C1F3ECAD10586E02E /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */; }; + 5337DF6516B114157BDCD4F0957801D0 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */; }; + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; + 6450DC9EC00124441CAB9D8535690EB4 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */; }; + 67FA28ADA5C61404EAEB8EE36F647FDC /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */; }; + 682AD79495052A0A6050DA92FCA57A19 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8390BF121CB383DD1401F46C5AA233 /* List.swift */; }; + 684364DEE25D2AF06EFE39858D990BF1 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */; }; + 7105B2BD1B0604B931E000F16375A335 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */; }; + 743033B7F8964EC3AC0C727285876396 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */; }; + 7AE18812CE9232702AF58A4AB11A3D4A /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */; }; + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; + 7B6B385930B1AE86207EB383F0E9EE2B /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */; }; + 7D554A5466BFF077A46F15FA5A3F3F6E /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */; }; + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; + 860196CD1483F19757C7C30460CD7CA4 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */; }; + 88D936AADB6658A0BC97E6CEC17499F7 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */; }; + 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; + 8AE1AE495DB124BB4E2D7059474CE42B /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0098C1592E8430B748726E544912A1 /* Name.swift */; }; + 906B042F9112F8CACC1B3DE516C50BF7 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 91CD595D13E4C78B57CBDC20C0C13209 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */; }; + 934A78EEFA3B86BFFEEFE8D4A6112260 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */; }; + 9573F1161F43C18D877073A50900A80D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 97E6DEC487E46176D3BA79ECEF5204C5 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E754BEE325D40D820E16CA799169C237 /* Extensions.swift */; }; + 9998431EE4A288A2E6DF7BAB4A930DD8 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */; }; + 9C1A054E67A88CC59D61E008F71E887E /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */; }; + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; + A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; + A8C7A08EC7E9FECA42EB7121E72B35E9 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */; }; + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; + ADC74AA8A82AFCC5B67BC92D4F4DB4EB /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */; }; + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; + AF3CFFEF5A1F0B1D4D1055AA2CF0D1AB /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */; }; + B477B88CCF55DFD09CCEEF6BD1FF3D2A /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */; }; + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; + C310B9190A08C4953C5165F339619A5B /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */; }; + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; + CCF54C34B39F632B57B1979B0EE6E11D /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */; }; + CF2FA6B16F54FBF111D56D9D57A5C51A /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */; }; + CFEF569B1FF3C7619EA8A735E2720D75 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */; }; + D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; + D92051A8C9E0A9D7972301C931875DE7 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */; }; + DD556A602A0205DC3BDFD3D9D4D042AA /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */; }; + E74D29AD603F3CDFE7789CC03E3290A5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + EF7F4564E588BA78CC981DF4C8432234 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; + F2CBCAA937A42298653726276FDC7318 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */; }; + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 0ABC7106E5053FCEDE01006541661549 /* PBXContainerItemProxy */ = { + 398B30E9B8AE28E1BDA1C6D292107659 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F; - remoteInfo = Alamofire; - }; - 319E90B185211EB0F7DB65C268512703 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E07B591B41E732703529E8F317CD7D8B; + remoteGlobalIDString = 34D7A419C45BE57FE477FC7690C6EB43; remoteInfo = PetstoreClient; }; - 9587C29FFB2EF204C279D7FF29DA45C2 /* PBXContainerItemProxy */ = { + 9D8246F31E2D7510C2F46D1FCC9731C2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + F9E1549CFEDAD61BECA92DB5B12B4019 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; remoteInfo = Alamofire; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; + 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 118386CB29E583E2BCF45FFB0C584C22 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 11A9D1B03B658EFF2011FD4ADF5B2C9B /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 13A0A663B36A229C69D5274A83E93F88 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 143E557A35666A5C3FB6A5EC601425AE /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 1C79F2ABDEC68FB086941B1667F653AC /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 1FCFC11EBD20C97FB1BC4EFAEC6FEB37 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 21B120C00973CD2A57F3D566E760AF3E /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 2364F4EAC509113B38791789DFC9F1E7 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 2E1E790656723DC52EAB91FF86121D3D /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 2E73416EE991BBE43467BA22F2A155A5 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 31C953CB2AF9E4E3D884BBA68E728307 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 37CE09CBDF55D26A9D95DD15E7DEA056 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 37E47D71F3FB3E8B7FBEA178972FB52D /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 3A7FD39D7BA8415D865896B06564C124 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 42105B8EAB28DFBC1FD088D5D8C08610 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 4B50A816814713052A83AD22ECB8E19D /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 4EBAF179E866C1F42E3C9F85162E2792 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - 4F28DB75084895EF23EDBC499D8B8BAE /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 540B42E772FF76C6D4F5E68CCDADA9B3 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 4C0098C1592E8430B748726E544912A1 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 5F939073B0FDC62477A0C4F8E9AB7131 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 6097AF9273FDB02C8A4DED04AFF6B4AD /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 6292ECC342913CF10F15F320C0D10143 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6E9F0D4DC6F738F2ECF8D716B7A9A5C7 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 68F1532A628EE993828CBA58896E7077 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; }; + 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 9928726B622806E400277C57963B354B /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - A73F00E8ED2521B115946B7E20B760AF /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - AAB8DD3379CB8E9DB0DC9E6B18356204 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - AC8DF8745F891F2A12590D73550D0490 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - B1300E3C28C82031FA5C87A7FE3B1EB9 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - B4CA6814AE828DFEC4A4C2C8C1D6CEA2 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - B4E90BC12F77D66B96AB27E026B2071E /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - BC23A659B67F5C77068CA536C88CA9D0 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; BCCA9CA7D9C1A2047BB93336C5708DFD /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - C9B2737214A9FBDFAFE4EFE2C5622B27 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + BD8390BF121CB383DD1401F46C5AA233 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D6115C108A2F1445CCA165DCE5321009 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - DFF589887A9AAE06637E527EC61117B0 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = ""; }; - E3FF8700849757249B929D7AFF652CD6 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - E906A19EC726985BD8493A893CA9DD65 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E754BEE325D40D820E16CA799169C237 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F2E15D74AD528E3350D207603BBA1DF4 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - F328163C591BBCCD1909AFA5B31CE95A /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - F8180325E22D8580EFE2473A67C0EAC0 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2A7053C6AF6D6D7610A715632949C369 /* Frameworks */ = { + 6FF96BC4D69AB5070FE79110C6420DE4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3CA0C61EB5AA01268C12B7E61FF59C56 /* Foundation.framework in Frameworks */, + EF7F4564E588BA78CC981DF4C8432234 /* Alamofire.framework in Frameworks */, + E74D29AD603F3CDFE7789CC03E3290A5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 3D4272E87CBABB7E63FD39A935D26603 /* Frameworks */ = { + 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6BE7B6EE63646366DD00EC3C286B2315 /* Alamofire.framework in Frameworks */, - EEBF1A088C53B7CA163809C3753C524D /* Foundation.framework in Frameworks */, + D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - B1729F851F648EC60EE93CDB3C8BAEAD /* Frameworks */ = { + 950A5F242B4B2310D94F7C4B29699C1E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 91C09AC2A52ED69A27C8D923139A006F /* Foundation.framework in Frameworks */, + 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - FE8FC779CF4B0CFCC594E81C0FF86C7E /* Frameworks */ = { + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F206C370F63155D3468E0C188498C5DC /* Foundation.framework in Frameworks */, + A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -257,6 +265,7 @@ B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */, 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */, ); + name = Alamofire; path = Alamofire; sourceTree = ""; }; @@ -268,12 +277,19 @@ name = "Development Pods"; sourceTree = ""; }; - 3332D79FDC0D66D4DF418974F676C0C0 /* iOS */ = { + 2C2F53D531E4AFD446B6ED6DEE846B7F /* Swaggers */ = { isa = PBXGroup; children = ( - 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */, + 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */, + 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */, + C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */, + E754BEE325D40D820E16CA799169C237 /* Extensions.swift */, + 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */, + FB1F6F6B93761E324908C8D85617C01F /* APIs */, + B68B316D246A5194B95DD72268A66457 /* Models */, ); - name = iOS; + name = Swaggers; + path = Swaggers; sourceTree = ""; }; 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { @@ -302,7 +318,7 @@ isa = PBXGroup; children = ( 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */, - 3332D79FDC0D66D4DF418974F676C0C0 /* iOS */, + 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */, ); name = Frameworks; sourceTree = ""; @@ -319,15 +335,12 @@ ); sourceTree = ""; }; - 88ACCBA930FB2930A6EB5386B54BB6AC /* APIs */ = { + 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */ = { isa = PBXGroup; children = ( - E906A19EC726985BD8493A893CA9DD65 /* FakeAPI.swift */, - BC23A659B67F5C77068CA536C88CA9D0 /* PetAPI.swift */, - F2E15D74AD528E3350D207603BBA1DF4 /* StoreAPI.swift */, - 118386CB29E583E2BCF45FFB0C584C22 /* UserAPI.swift */, + 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */, ); - path = APIs; + name = iOS; sourceTree = ""; }; 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { @@ -348,42 +361,6 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8C92F4FC4122BA0949B5E0332BC5DA9A /* Models */ = { - isa = PBXGroup; - children = ( - F328163C591BBCCD1909AFA5B31CE95A /* AdditionalPropertiesClass.swift */, - 4B50A816814713052A83AD22ECB8E19D /* Animal.swift */, - 6097AF9273FDB02C8A4DED04AFF6B4AD /* AnimalFarm.swift */, - B4CA6814AE828DFEC4A4C2C8C1D6CEA2 /* ApiResponse.swift */, - 540B42E772FF76C6D4F5E68CCDADA9B3 /* ArrayOfArrayOfNumberOnly.swift */, - 4EBAF179E866C1F42E3C9F85162E2792 /* ArrayOfNumberOnly.swift */, - 21B120C00973CD2A57F3D566E760AF3E /* ArrayTest.swift */, - 4F28DB75084895EF23EDBC499D8B8BAE /* Cat.swift */, - 37E47D71F3FB3E8B7FBEA178972FB52D /* Category.swift */, - 9928726B622806E400277C57963B354B /* Client.swift */, - AAB8DD3379CB8E9DB0DC9E6B18356204 /* Dog.swift */, - 1FCFC11EBD20C97FB1BC4EFAEC6FEB37 /* EnumArrays.swift */, - D6115C108A2F1445CCA165DCE5321009 /* EnumClass.swift */, - 42105B8EAB28DFBC1FD088D5D8C08610 /* EnumTest.swift */, - 11A9D1B03B658EFF2011FD4ADF5B2C9B /* FormatTest.swift */, - AC8DF8745F891F2A12590D73550D0490 /* HasOnlyReadOnly.swift */, - 3A7FD39D7BA8415D865896B06564C124 /* List.swift */, - DFF589887A9AAE06637E527EC61117B0 /* MapTest.swift */, - 37CE09CBDF55D26A9D95DD15E7DEA056 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 31C953CB2AF9E4E3D884BBA68E728307 /* Model200Response.swift */, - 1C79F2ABDEC68FB086941B1667F653AC /* Name.swift */, - B4E90BC12F77D66B96AB27E026B2071E /* NumberOnly.swift */, - 2364F4EAC509113B38791789DFC9F1E7 /* Order.swift */, - B1300E3C28C82031FA5C87A7FE3B1EB9 /* Pet.swift */, - C9B2737214A9FBDFAFE4EFE2C5622B27 /* ReadOnlyFirst.swift */, - 2E1E790656723DC52EAB91FF86121D3D /* Return.swift */, - 5F939073B0FDC62477A0C4F8E9AB7131 /* SpecialModelName.swift */, - 143E557A35666A5C3FB6A5EC601425AE /* Tag.swift */, - F8180325E22D8580EFE2473A67C0EAC0 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { isa = PBXGroup; children = ( @@ -412,23 +389,50 @@ AD94092456F8ABCB18F74CAC75AD85DE /* Classes */ = { isa = PBXGroup; children = ( - BD3FA7FC606B6CEBD6392587B3661483 /* Swaggers */, + 2C2F53D531E4AFD446B6ED6DEE846B7F /* Swaggers */, ); + name = Classes; path = Classes; sourceTree = ""; }; - BD3FA7FC606B6CEBD6392587B3661483 /* Swaggers */ = { + B68B316D246A5194B95DD72268A66457 /* Models */ = { isa = PBXGroup; children = ( - 6292ECC342913CF10F15F320C0D10143 /* AlamofireImplementations.swift */, - A73F00E8ED2521B115946B7E20B760AF /* APIHelper.swift */, - 6E9F0D4DC6F738F2ECF8D716B7A9A5C7 /* APIs.swift */, - E3FF8700849757249B929D7AFF652CD6 /* Extensions.swift */, - 2E73416EE991BBE43467BA22F2A155A5 /* Models.swift */, - 88ACCBA930FB2930A6EB5386B54BB6AC /* APIs */, - 8C92F4FC4122BA0949B5E0332BC5DA9A /* Models */, + CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */, + 68F1532A628EE993828CBA58896E7077 /* Animal.swift */, + 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */, + C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */, + ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */, + AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */, + 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */, + FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */, + 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */, + 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */, + 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */, + 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */, + A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */, + DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */, + CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */, + D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */, + 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */, + 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */, + BD8390BF121CB383DD1401F46C5AA233 /* List.swift */, + 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */, + 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */, + 4C0098C1592E8430B748726E544912A1 /* Name.swift */, + A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */, + B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */, + BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */, + 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */, + C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */, + CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */, + BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */, + ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */, + 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */, ); - path = Swaggers; + name = Models; + path = Models; sourceTree = ""; }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { @@ -463,6 +467,7 @@ children = ( AD94092456F8ABCB18F74CAC75AD85DE /* Classes */, ); + name = PetstoreClient; path = PetstoreClient; sourceTree = ""; }; @@ -476,87 +481,101 @@ path = ../..; sourceTree = ""; }; + FB1F6F6B93761E324908C8D85617C01F /* APIs */ = { + isa = PBXGroup; + children = ( + B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */, + A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */, + 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */, + CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */, + 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */, + ); + name = APIs; + path = APIs; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 8EB9FB8BCBCBC01234ED5877A870758B /* Headers */ = { + 1353AC7A6419F876B294A55E5550D1E4 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 816BE1BBC1F4E434D7BD3F793F38B347 /* Pods-SwaggerClient-umbrella.h in Headers */, + 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - A257EA6B7E444E7E15D7C099076AFCC4 /* Headers */ = { + 60CD6F00C2BDEAD10522E5DDF98A4FD1 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 1E4C6B6A8D716620DE786BBF7DEAD993 /* PetstoreClient-umbrella.h in Headers */, + 906B042F9112F8CACC1B3DE516C50BF7 /* PetstoreClient-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - EFDF3B631BBB965A372347705CA14854 /* Headers */ = { + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9469DF81ECB494E84675969B5E13374C /* Alamofire-umbrella.h in Headers */, + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - FF84DA06E91FBBAA756A7832375803CE /* Headers */ = { + DC071B9D59E4680147F481F53FBCE180 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 897283A0B7F5299913327CC8FD6CC997 /* Pods-SwaggerClientTests-umbrella.h in Headers */, + 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 01C67FBB627BDC9D36B9F648C0BF5228 /* Pods-SwaggerClient */ = { + 34D7A419C45BE57FE477FC7690C6EB43 /* PetstoreClient */ = { isa = PBXNativeTarget; - buildConfigurationList = A255A180370C09C28653A0EC123D2678 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; + buildConfigurationList = 5C20281827228C999505802256DA894B /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - C2AD20E62D6A15C7CE3E20F8A811548F /* Sources */, - 2A7053C6AF6D6D7610A715632949C369 /* Frameworks */, - 8EB9FB8BCBCBC01234ED5877A870758B /* Headers */, + 308F8E580759C366F1047ACF5DA16606 /* Sources */, + 6FF96BC4D69AB5070FE79110C6420DE4 /* Frameworks */, + 60CD6F00C2BDEAD10522E5DDF98A4FD1 /* Headers */, ); buildRules = ( ); dependencies = ( - 9D7C00D5DABDA9EE2ED06BE7F85DD5EA /* PBXTargetDependency */, - A51999658423B0F25DD2B4FEECD542E3 /* PBXTargetDependency */, + F12F3952E06A7C1F9A5F0CBF0EC91B9B /* PBXTargetDependency */, + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 41903051A113E887E262FB29130EB187 /* Pods-SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; + buildPhases = ( + 9A1B5AE4D97D5E0097B7054904D06663 /* Sources */, + 950A5F242B4B2310D94F7C4B29699C1E /* Frameworks */, + DC071B9D59E4680147F481F53FBCE180 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + AC31F7EF81A7A1C4862B1BA6879CEC1C /* PBXTargetDependency */, + 374AD22F26F7E9801AB27C2FCBBF4EC9 /* PBXTargetDependency */, ); name = "Pods-SwaggerClient"; productName = "Pods-SwaggerClient"; productReference = 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */; productType = "com.apple.product-type.framework"; }; - 462B200BD111D7F438E47B7C42B6772F /* Pods-SwaggerClientTests */ = { + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { isa = PBXNativeTarget; - buildConfigurationList = 245A935A321D16F418F4D34C5D17D2B6 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; + buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; buildPhases = ( - 0529825EC79AED06C77091DC0F061854 /* Sources */, - FE8FC779CF4B0CFCC594E81C0FF86C7E /* Frameworks */, - FF84DA06E91FBBAA756A7832375803CE /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Pods-SwaggerClientTests"; - productName = "Pods-SwaggerClientTests"; - productReference = EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */; - productType = "com.apple.product-type.framework"; - }; - 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3CFB42910790CF0BDBCCEBAACD6B9367 /* Build configuration list for PBXNativeTarget "Alamofire" */; - buildPhases = ( - 120C4E824DDCCA024C170A491FF221A5 /* Sources */, - B1729F851F648EC60EE93CDB3C8BAEAD /* Frameworks */, - EFDF3B631BBB965A372347705CA14854 /* Headers */, + 32B9974868188C4803318E36329C87FE /* Sources */, + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, ); buildRules = ( ); @@ -567,22 +586,21 @@ productReference = 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */; productType = "com.apple.product-type.framework"; }; - E07B591B41E732703529E8F317CD7D8B /* PetstoreClient */ = { + F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */ = { isa = PBXNativeTarget; - buildConfigurationList = 82BA95898374BB6547C3BE7BF6756979 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildConfigurationList = B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; buildPhases = ( - 2420666CEC71977046A755480622789D /* Sources */, - 3D4272E87CBABB7E63FD39A935D26603 /* Frameworks */, - A257EA6B7E444E7E15D7C099076AFCC4 /* Headers */, + BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */, + 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */, + 1353AC7A6419F876B294A55E5550D1E4 /* Headers */, ); buildRules = ( ); dependencies = ( - 28CF5404866D77A932CAA3AAA52E77C5 /* PBXTargetDependency */, ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */; + name = "Pods-SwaggerClientTests"; + productName = "Pods-SwaggerClientTests"; + productReference = EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -606,188 +624,131 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */, - E07B591B41E732703529E8F317CD7D8B /* PetstoreClient */, - 01C67FBB627BDC9D36B9F648C0BF5228 /* Pods-SwaggerClient */, - 462B200BD111D7F438E47B7C42B6772F /* Pods-SwaggerClientTests */, + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, + 34D7A419C45BE57FE477FC7690C6EB43 /* PetstoreClient */, + 41903051A113E887E262FB29130EB187 /* Pods-SwaggerClient */, + F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 0529825EC79AED06C77091DC0F061854 /* Sources */ = { + 308F8E580759C366F1047ACF5DA16606 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C546890220177F840E8AFC829D0E3FEB /* Pods-SwaggerClientTests-dummy.m in Sources */, + 7105B2BD1B0604B931E000F16375A335 /* AdditionalPropertiesClass.swift in Sources */, + 4A61D9C5338D311C1F3ECAD10586E02E /* AlamofireImplementations.swift in Sources */, + 08C43F202E7FC3E8F2730CCB9FBD7998 /* Animal.swift in Sources */, + B477B88CCF55DFD09CCEEF6BD1FF3D2A /* AnimalFarm.swift in Sources */, + 9C1A054E67A88CC59D61E008F71E887E /* APIHelper.swift in Sources */, + 9998431EE4A288A2E6DF7BAB4A930DD8 /* ApiResponse.swift in Sources */, + CFEF569B1FF3C7619EA8A735E2720D75 /* APIs.swift in Sources */, + 39F639E647EE2C7BBBE1D600D5460A09 /* ArrayOfArrayOfNumberOnly.swift in Sources */, + CF2FA6B16F54FBF111D56D9D57A5C51A /* ArrayOfNumberOnly.swift in Sources */, + 7B6B385930B1AE86207EB383F0E9EE2B /* ArrayTest.swift in Sources */, + 40B3F80E1C272838FA43C7C60D600B13 /* Capitalization.swift in Sources */, + 91CD595D13E4C78B57CBDC20C0C13209 /* Cat.swift in Sources */, + 1627426CA13781AE27C0FC0C98F6A88D /* Category.swift in Sources */, + AF3CFFEF5A1F0B1D4D1055AA2CF0D1AB /* ClassModel.swift in Sources */, + CCF54C34B39F632B57B1979B0EE6E11D /* Client.swift in Sources */, + 250F58C891252EFD0C30E681503B370A /* Dog.swift in Sources */, + 218599F3A5EF5064545F1C63CD2014ED /* EnumArrays.swift in Sources */, + 3A93D7E1111888C47B0138AE97A5012A /* EnumClass.swift in Sources */, + 0BD2D76CD41573EC2B53977627E0D5BB /* EnumTest.swift in Sources */, + 97E6DEC487E46176D3BA79ECEF5204C5 /* Extensions.swift in Sources */, + 67FA28ADA5C61404EAEB8EE36F647FDC /* FakeAPI.swift in Sources */, + 5337DF6516B114157BDCD4F0957801D0 /* FakeclassnametagsAPI.swift in Sources */, + A8C7A08EC7E9FECA42EB7121E72B35E9 /* FormatTest.swift in Sources */, + D92051A8C9E0A9D7972301C931875DE7 /* HasOnlyReadOnly.swift in Sources */, + 682AD79495052A0A6050DA92FCA57A19 /* List.swift in Sources */, + C310B9190A08C4953C5165F339619A5B /* MapTest.swift in Sources */, + 9573F1161F43C18D877073A50900A80D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 101544113D88337D6D76FC4B35796A04 /* Model200Response.swift in Sources */, + 7AE18812CE9232702AF58A4AB11A3D4A /* Models.swift in Sources */, + 8AE1AE495DB124BB4E2D7059474CE42B /* Name.swift in Sources */, + 14173079C167B121B3165D371B1025B0 /* NumberOnly.swift in Sources */, + 3E2E6328563E0FA71FE88D30BC1736D7 /* Order.swift in Sources */, + 7D554A5466BFF077A46F15FA5A3F3F6E /* OuterEnum.swift in Sources */, + 6450DC9EC00124441CAB9D8535690EB4 /* Pet.swift in Sources */, + F2CBCAA937A42298653726276FDC7318 /* PetAPI.swift in Sources */, + 349A70A41286448022F4219D4FDE0678 /* PetstoreClient-dummy.m in Sources */, + 860196CD1483F19757C7C30460CD7CA4 /* ReadOnlyFirst.swift in Sources */, + ADC74AA8A82AFCC5B67BC92D4F4DB4EB /* Return.swift in Sources */, + 743033B7F8964EC3AC0C727285876396 /* SpecialModelName.swift in Sources */, + DD556A602A0205DC3BDFD3D9D4D042AA /* StoreAPI.swift in Sources */, + 88D936AADB6658A0BC97E6CEC17499F7 /* Tag.swift in Sources */, + 934A78EEFA3B86BFFEEFE8D4A6112260 /* User.swift in Sources */, + 684364DEE25D2AF06EFE39858D990BF1 /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 120C4E824DDCCA024C170A491FF221A5 /* Sources */ = { + 32B9974868188C4803318E36329C87FE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 62143065F94E53F437DCE5D7A998D66D /* AFError.swift in Sources */, - 8D463A0A4C65C02FDD5211F0F3C6F8B8 /* Alamofire-dummy.m in Sources */, - 7CA5A9BA5246FDA8227233E310029392 /* Alamofire.swift in Sources */, - E2A1C34237B4E928E5F85C097F4C2551 /* DispatchQueue+Alamofire.swift in Sources */, - C7A3408350643ADE1018826C766EE356 /* MultipartFormData.swift in Sources */, - E59BF19C0AFA68B741552319FC478C7B /* NetworkReachabilityManager.swift in Sources */, - 0C1B4E9FFB8B81E8833A3BAD537B1990 /* Notifications.swift in Sources */, - AF158CAAF4DD319009AFC855DC995D90 /* ParameterEncoding.swift in Sources */, - 12118C354EFA36292F82A8D0CFCE45B2 /* Request.swift in Sources */, - 86ED08F33B7D357932A9AB743E9D9EA7 /* Response.swift in Sources */, - B8154C96802336E5DDA5CEE97C3180A0 /* ResponseSerialization.swift in Sources */, - DF1BBF94997A2F4248B42B25EA919EC2 /* Result.swift in Sources */, - C0AEA97E7684DDAD56998C0AE198A433 /* ServerTrustPolicy.swift in Sources */, - 907AB123FBC8BC9340D5B7350CE828DF /* SessionDelegate.swift in Sources */, - A79AC30123B0C2177D67F6ED6A1B3215 /* SessionManager.swift in Sources */, - E1F583CB4A68A928CD197250AA752926 /* TaskDelegate.swift in Sources */, - 3982B850C43B41BA6D25F440F0412E9B /* Timeline.swift in Sources */, - FFFDD494EE6D1B83DDAF5F2721F685A6 /* Validation.swift in Sources */, + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */, + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */, + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */, + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */, + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */, + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */, + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */, + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */, + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */, + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */, + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */, + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */, + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */, + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */, + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */, + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */, + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */, + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 2420666CEC71977046A755480622789D /* Sources */ = { + 9A1B5AE4D97D5E0097B7054904D06663 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D4EA06289110B4F5DC19DDDE8831FF5F /* AdditionalPropertiesClass.swift in Sources */, - D0BA8173A676167CAC2973A79BD0242E /* AlamofireImplementations.swift in Sources */, - 4CEA56A149345E34DBFB8F26836ADA7D /* Animal.swift in Sources */, - 33A38B024F2FAF97CD18BE77E1B59AC6 /* AnimalFarm.swift in Sources */, - BDD68D9A8AFC895FE449F76B45BB7635 /* APIHelper.swift in Sources */, - EB28CEEA7D16626E36446A03BDA3B99B /* ApiResponse.swift in Sources */, - 8FFF3001784D9A7F0C499B533D71DD4C /* APIs.swift in Sources */, - 1AD5AD2C098CCCC2B6F7214BF604CB9B /* ArrayOfArrayOfNumberOnly.swift in Sources */, - E9722CFC027D91761F36943C8EF0737C /* ArrayOfNumberOnly.swift in Sources */, - 70C02206CAF9D7E01C51B4529C8AD123 /* ArrayTest.swift in Sources */, - 06C3C2F3A8B5B1D1AAC0D29ECC8B5970 /* Cat.swift in Sources */, - 13F7C9AF056DF8BA92AB2BAF217D8D04 /* Category.swift in Sources */, - A69008B3AAFE217515CAC19EC2BBB8D5 /* Client.swift in Sources */, - D5E6B1E3BD16CF981E24E74371C95A8F /* Dog.swift in Sources */, - 588EFA41BF51F86A0ACA00AE2129D24E /* EnumArrays.swift in Sources */, - FE1EAE93BA87614AA129DE8223AA5B7A /* EnumClass.swift in Sources */, - 434EA46C36A82495415C5311DE52DEE6 /* EnumTest.swift in Sources */, - 8146DC6C21BC6B7D6E9F1C614BC1B9C2 /* Extensions.swift in Sources */, - 9460E7ECF6325A1C9EED36372DBC3D6D /* FakeAPI.swift in Sources */, - BB42BBFB6683977C7DC25EC32D9EAA72 /* FormatTest.swift in Sources */, - 5FD117885B2A8748C851D3BEF7EEEF06 /* HasOnlyReadOnly.swift in Sources */, - A3B4B8D0EC2ED8909876E2CB361AF87F /* List.swift in Sources */, - FC37FC0FD78A4BF0BBA8E7B1FE56D473 /* MapTest.swift in Sources */, - 6C0889CCE8E1D85E698D8EC564C4853E /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 0D420ED1DD1A8E1BF24FC85ABB82D669 /* Model200Response.swift in Sources */, - 37E67199CFA606106C726BA6CFC0B4D3 /* Models.swift in Sources */, - 426B7FD8E61D930DE16BAC12FB726CE2 /* Name.swift in Sources */, - 1FB3F9E6B2DC47002778D605F14939D6 /* NumberOnly.swift in Sources */, - A37E7B4926057F8DC36D5EF5E17CE722 /* Order.swift in Sources */, - B656F729908BDC89686840DB4797E41E /* Pet.swift in Sources */, - 1C5DDB3A511B358ECC2B4BAE060ED9FC /* PetAPI.swift in Sources */, - 925D027E2FCA75AB2B2F2195EB14AFBB /* PetstoreClient-dummy.m in Sources */, - 03EE41C7303FF17FFB50AC1365929CF7 /* ReadOnlyFirst.swift in Sources */, - 5E25A9DF7FE0293488B24739844CFA4E /* Return.swift in Sources */, - C99577B805EB3E6EDCDA06D0E6253B41 /* SpecialModelName.swift in Sources */, - BAB7DEE435F7E246160AF61B1A52613D /* StoreAPI.swift in Sources */, - 736ABF80511158678C6068F0EA6C4F5E /* Tag.swift in Sources */, - F96E0891F2AE26D2CA24BD31378328A9 /* User.swift in Sources */, - 9FC9759E7BA02FF67AE579C8A0043D96 /* UserAPI.swift in Sources */, + D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - C2AD20E62D6A15C7CE3E20F8A811548F /* Sources */ = { + BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8592AD030234E841A61CA09ED02059A /* Pods-SwaggerClient-dummy.m in Sources */, + 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 28CF5404866D77A932CAA3AAA52E77C5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */; - targetProxy = 0ABC7106E5053FCEDE01006541661549 /* PBXContainerItemProxy */; - }; - 9D7C00D5DABDA9EE2ED06BE7F85DD5EA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */; - targetProxy = 9587C29FFB2EF204C279D7FF29DA45C2 /* PBXContainerItemProxy */; - }; - A51999658423B0F25DD2B4FEECD542E3 /* PBXTargetDependency */ = { + 374AD22F26F7E9801AB27C2FCBBF4EC9 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PetstoreClient; - target = E07B591B41E732703529E8F317CD7D8B /* PetstoreClient */; - targetProxy = 319E90B185211EB0F7DB65C268512703 /* PBXContainerItemProxy */; + target = 34D7A419C45BE57FE477FC7690C6EB43 /* PetstoreClient */; + targetProxy = 398B30E9B8AE28E1BDA1C6D292107659 /* PBXContainerItemProxy */; + }; + AC31F7EF81A7A1C4862B1BA6879CEC1C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = F9E1549CFEDAD61BECA92DB5B12B4019 /* PBXContainerItemProxy */; + }; + F12F3952E06A7C1F9A5F0CBF0EC91B9B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 9D8246F31E2D7510C2F46D1FCC9731C2 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 08217EFF5AE225FB3D3816849CCDF66F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 0D28399EAD3AC3480543B89AE77A5816 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 28688FC81A059766780FB9F6BB85F7D8 /* Release */ = { + 0AE21DC98CE46514764D58B99D2EF07E /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { @@ -821,7 +782,38 @@ }; name = Release; }; - 3096AA3D2BA784C99CFE15B1C8943116 /* Debug */ = { + 2E330FDE8D9D1759ABF2B17413641A14 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3881E269CDB75091FD35AE2BD08739AB /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; buildSettings = { @@ -856,7 +848,7 @@ }; name = Debug; }; - 784D45BD01B6A4A066ED5EC84115205A /* Release */ = { + 4FF15CD2E3E7EE34B0314A62CFC36528 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { @@ -886,6 +878,74 @@ }; name = Release; }; + 5031D65C40F6E6417C6A44C5FBDF15BD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 5436E1B569734D2A2B26DF9A9F61E63B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 84FD87D359382A37B07149A12641B965 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -928,81 +988,13 @@ }; name = Debug; }; - 99064127142A5DB1486ADFDCF5E23212 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - A5192F795717DBFBB3C9BA9482C76842 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - DB6DBC56AD82D27A6A01A50AA577557F /* Debug */ = { + D160E7A504BD3CFDD475975ED3A658A0 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1015,17 +1007,16 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; F594C655D48020EC34B00AA63E001773 /* Release */ = { isa = XCBuildConfiguration; @@ -1065,18 +1056,40 @@ }; name = Release; }; + FB412512A164FCE95718CEB6CB9C366F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 245A935A321D16F418F4D34C5D17D2B6 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A5192F795717DBFBB3C9BA9482C76842 /* Debug */, - 99064127142A5DB1486ADFDCF5E23212 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1086,29 +1099,38 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3CFB42910790CF0BDBCCEBAACD6B9367 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - 08217EFF5AE225FB3D3816849CCDF66F /* Debug */, - 784D45BD01B6A4A066ED5EC84115205A /* Release */, + FB412512A164FCE95718CEB6CB9C366F /* Debug */, + 4FF15CD2E3E7EE34B0314A62CFC36528 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 82BA95898374BB6547C3BE7BF6756979 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + 5C20281827228C999505802256DA894B /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - DB6DBC56AD82D27A6A01A50AA577557F /* Debug */, - 0D28399EAD3AC3480543B89AE77A5816 /* Release */, + 2E330FDE8D9D1759ABF2B17413641A14 /* Debug */, + D160E7A504BD3CFDD475975ED3A658A0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A255A180370C09C28653A0EC123D2678 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3096AA3D2BA784C99CFE15B1C8943116 /* Debug */, - 28688FC81A059766780FB9F6BB85F7D8 /* Release */, + 3881E269CDB75091FD35AE2BD08739AB /* Debug */, + 0AE21DC98CE46514764D58B99D2EF07E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5031D65C40F6E6417C6A44C5FBDF15BD /* Debug */, + 5436E1B569734D2A2B26DF9A9F61E63B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown index 938fc5f29a8..102af753851 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown @@ -1,231 +1,3 @@ # Acknowledgements This application makes use of the following third party libraries: - -## Alamofire - -Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## PetstoreClient - - 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. - Generated by CocoaPods - https://cocoapods.org diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist index 289edb2592c..7acbad1eabb 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist @@ -12,242 +12,6 @@ Type PSGroupSpecifier - - FooterText - Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - Title - Alamofire - Type - PSGroupSpecifier - - - FooterText - 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. - - Title - PetstoreClient - Type - PSGroupSpecifier - FooterText Generated by CocoaPods - https://cocoapods.org diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index e3a1e42ab41..3847ae1dc6a 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -321,7 +321,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ 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 7ad45266818..740bc511fff 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 @@ -52,7 +52,7 @@ open class StoreAPI: APIBase { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -189,7 +189,7 @@ open class StoreAPI: APIBase { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index df82ead3886..976fa6cc0da 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -327,7 +327,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ 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 59765011f56..465a7689469 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 @@ -54,7 +54,7 @@ open class StoreAPI: APIBase { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -195,7 +195,7 @@ open class StoreAPI: APIBase { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil From 22eb72791c4184d3697170dfa654389c322a3f95 Mon Sep 17 00:00:00 2001 From: zszugyi Date: Sat, 1 Apr 2017 01:11:00 -0700 Subject: [PATCH 04/13] Specify copy option to overwrite existing temp file, otherwise Files.copy throws FileAlreadyExistsException (#5268) --- .../2_0/templates/Java/libraries/jersey2/ApiClient.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache index 07e857e75df..96df77be8e9 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache @@ -27,6 +27,7 @@ import java.io.InputStream; {{^supportJava6}} import java.nio.file.Files; +import java.nio.file.StandardCopyOption; {{/supportJava6}} {{#supportJava6}} import org.apache.commons.io.FileUtils; @@ -581,7 +582,7 @@ public class ApiClient { try { File file = prepareDownloadFile(response); {{^supportJava6}} - Files.copy(response.readEntity(InputStream.class), file.toPath()); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); {{/supportJava6}} {{#supportJava6}} // Java6 falls back to commons.io for file copying From e96db749186c5d3b3cfbec580e2f050c4f7d7ee1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 1 Apr 2017 16:19:31 +0800 Subject: [PATCH 05/13] update java jersey2 petstore clients --- .../client/petstore/java/jersey2-java6/docs/StoreApi.md | 4 ++-- .../src/main/java/io/swagger/client/api/StoreApi.java | 8 ++++---- samples/client/petstore/java/jersey2/docs/StoreApi.md | 4 ++-- .../src/main/java/io/swagger/client/api/StoreApi.java | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java index d0a1e843743..22be0ebb027 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/docs/StoreApi.md b/samples/client/petstore/java/jersey2/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 d0a1e843743..22be0ebb027 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,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); From 64c7e23a04d68db9ad27f11295141d8df4b413b9 Mon Sep 17 00:00:00 2001 From: Granjow Date: Sat, 1 Apr 2017 10:33:29 +0200 Subject: [PATCH 06/13] TypeScript client API: Add public getter/setter for base path (#5270) --- .../resources/typescript-node/api.mustache | 10 +++++- .../petstore/typescript-node/default/api.ts | 34 ++++++++++++++++--- .../petstore/typescript-node/npm/api.ts | 34 ++++++++++++++++--- 3 files changed, 67 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 0a9d023c31a..adfdfd035a3 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -116,7 +116,7 @@ export enum {{classname}}ApiKeys { } export class {{classname}} { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -163,6 +163,14 @@ export class {{classname}} { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: {{classname}}ApiKeys, value: string) { this.authentications[{{classname}}ApiKeys[key]].apiKey = value; } diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index edfe1a4fef3..274b84d927d 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -140,7 +140,7 @@ export enum PetApiApiKeys { } export class PetApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -167,6 +167,14 @@ export class PetApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: PetApiApiKeys, value: string) { this.authentications[PetApiApiKeys[key]].apiKey = value; } @@ -413,10 +421,10 @@ export class PetApi { json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { @@ -624,7 +632,7 @@ export enum StoreApiApiKeys { } export class StoreApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -651,6 +659,14 @@ export class StoreApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: StoreApiApiKeys, value: string) { this.authentications[StoreApiApiKeys[key]].apiKey = value; } @@ -862,7 +878,7 @@ export enum UserApiApiKeys { } export class UserApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -889,6 +905,14 @@ export class UserApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: UserApiApiKeys, value: string) { this.authentications[UserApiApiKeys[key]].apiKey = value; } diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index edfe1a4fef3..274b84d927d 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -140,7 +140,7 @@ export enum PetApiApiKeys { } export class PetApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -167,6 +167,14 @@ export class PetApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: PetApiApiKeys, value: string) { this.authentications[PetApiApiKeys[key]].apiKey = value; } @@ -413,10 +421,10 @@ export class PetApi { json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { @@ -624,7 +632,7 @@ export enum StoreApiApiKeys { } export class StoreApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -651,6 +659,14 @@ export class StoreApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: StoreApiApiKeys, value: string) { this.authentications[StoreApiApiKeys[key]].apiKey = value; } @@ -862,7 +878,7 @@ export enum UserApiApiKeys { } export class UserApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -889,6 +905,14 @@ export class UserApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: UserApiApiKeys, value: string) { this.authentications[UserApiApiKeys[key]].apiKey = value; } From bc8e16e3f81708a85f6d164343e015e250dd88e8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 1 Apr 2017 21:12:17 +0800 Subject: [PATCH 07/13] fix package name in mono test script (#5278) --- .../src/main/resources/csharp/mono_nunit_test.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache index 5593bfdd94f..4a2fa5f58a3 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache @@ -7,7 +7,7 @@ wget -nc https://nuget.org/nuget.exe mozroots --import --sync echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" -rm src/IO.Swagger.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null +rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null echo "[INFO] install NUnit runners via NuGet" wget -nc https://nuget.org/nuget.exe From ca6b5d09d040ec1d7fdff0a4abd078c8b2209a73 Mon Sep 17 00:00:00 2001 From: jfiala Date: Sun, 2 Apr 2017 10:05:16 +0200 Subject: [PATCH 08/13] [Jaxrs-cxf] Add check for useGenericResponse for jaxrs-cxf server + client (#4779) * add check for useGenericResponse for jaxrs-cxf * move check for genericresponse to cxf codegen #4713 --- .../AbstractJavaJAXRSServerCodegen.java | 32 +- .../languages/JavaCXFClientCodegen.java | 47 ++- .../languages/JavaCXFServerCodegen.java | 19 +- .../features/UseGenericResponseFeatures.java | 9 + .../JavaJaxRS/cxf/apiServiceImpl.mustache | 2 +- .../JavaJaxRS/cxf/enumOuterClass.mustache | 5 + .../JavaJaxRS/cxf/returnTypes.mustache | 5 +- .../jaxrs/JaxrsCXFClientOptionsTest.java | 4 + .../jaxrs/JaxrsCXFServerOptionsTest.java | 2 + .../options/JavaCXFClientOptionsProvider.java | 3 + .../options/JavaCXFServerOptionsProvider.java | 3 + samples/client/petstore/jaxrs-cxf/LICENSE | 201 ------------ .../src/gen/java/io/swagger/api/FakeApi.java | 45 +++ .../src/gen/java/io/swagger/api/PetApi.java | 24 +- .../src/gen/java/io/swagger/api/StoreApi.java | 11 +- .../src/gen/java/io/swagger/api/UserApi.java | 19 +- .../model/AdditionalPropertiesClass.java | 90 +++++ .../src/gen/java/io/swagger/model/Animal.java | 77 +++++ .../gen/java/io/swagger/model/AnimalFarm.java | 40 +++ .../model/ArrayOfArrayOfNumberOnly.java | 65 ++++ .../io/swagger/model/ArrayOfNumberOnly.java | 65 ++++ .../gen/java/io/swagger/model/ArrayTest.java | 115 +++++++ .../java/io/swagger/model/Capitalization.java | 157 +++++++++ .../src/gen/java/io/swagger/model/Cat.java | 58 ++++ .../gen/java/io/swagger/model/Category.java | 16 +- .../gen/java/io/swagger/model/ClassModel.java | 59 ++++ .../src/gen/java/io/swagger/model/Client.java | 57 ++++ .../src/gen/java/io/swagger/model/Dog.java | 58 ++++ .../gen/java/io/swagger/model/EnumArrays.java | 150 +++++++++ .../gen/java/io/swagger/model/EnumClass.java | 37 +++ .../gen/java/io/swagger/model/EnumTest.java | 217 ++++++++++++ .../gen/java/io/swagger/model/FormatTest.java | 310 ++++++++++++++++++ .../io/swagger/model/HasOnlyReadOnly.java | 61 ++++ .../gen/java/io/swagger/model/MapTest.java | 123 +++++++ ...ropertiesAndAdditionalPropertiesClass.java | 107 ++++++ .../io/swagger/model/Model200Response.java | 79 +++++ .../io/swagger/model/ModelApiResponse.java | 23 +- .../java/io/swagger/model/ModelReturn.java | 59 ++++ .../src/gen/java/io/swagger/model/Name.java | 103 ++++++ .../gen/java/io/swagger/model/NumberOnly.java | 58 ++++ .../src/gen/java/io/swagger/model/Order.java | 46 ++- .../gen/java/io/swagger/model/OuterEnum.java | 37 +++ .../src/gen/java/io/swagger/model/Pet.java | 56 +++- .../java/io/swagger/model/ReadOnlyFirst.java | 69 ++++ .../io/swagger/model/SpecialModelName.java | 57 ++++ .../src/gen/java/io/swagger/model/Tag.java | 16 +- .../src/gen/java/io/swagger/model/User.java | 58 +++- .../test/java/io/swagger/api/FakeApiTest.java | 146 +++++++++ .../test/java/io/swagger/api/PetApiTest.java | 48 ++- .../java/io/swagger/api/StoreApiTest.java | 20 +- .../test/java/io/swagger/api/UserApiTest.java | 46 ++- .../jaxrs-cxf/.swagger-codegen-ignore | 2 + .../gen/java/io/swagger/model/EnumClass.java | 1 + .../gen/java/io/swagger/model/OuterEnum.java | 1 + .../test/java/io/swagger/api/PetApiTest.java | 12 +- .../java/io/swagger/api/StoreApiTest.java | 6 +- .../test/java/io/swagger/api/UserApiTest.java | 16 +- 57 files changed, 2935 insertions(+), 317 deletions(-) create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java delete mode 100644 samples/client/petstore/jaxrs-cxf/LICENSE create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java create mode 100644 samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java 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 b83be9ebd01..1b753f8ebe0 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 @@ -1,15 +1,25 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; -import io.swagger.codegen.languages.features.BeanValidationFeatures; -import io.swagger.models.Operation; -import io.swagger.models.Path; -import io.swagger.models.Swagger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; +import io.swagger.codegen.CliOption; +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.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; +import io.swagger.models.Operation; +import io.swagger.models.Path; +import io.swagger.models.Swagger; public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { /** @@ -25,8 +35,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); - public AbstractJavaJAXRSServerCodegen() - { + public AbstractJavaJAXRSServerCodegen() { super(); sourceFolder = "src/gen/java"; @@ -46,7 +55,6 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(new CliOption("serverPort", "The port on which the server should be started")); - } @@ -55,8 +63,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen // =============== @Override - public CodegenType getTag() - { + public CodegenType getTag() { return CodegenType.SERVER; } @@ -84,7 +91,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen swagger.setBasePath(""); } - if(!this.additionalProperties.containsKey("serverPort")) { + if (!this.additionalProperties.containsKey("serverPort")) { final String host = swagger.getHost(); String port = "8080"; // Default value for a JEE Server if ( host != null ) { @@ -235,4 +242,5 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen this.useBeanValidation = useBeanValidation; } + } 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 214b73e0e29..5edd70e2ca1 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 @@ -11,19 +11,22 @@ import org.slf4j.LoggerFactory; import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.CodegenResponse; import io.swagger.codegen.CodegenType; import io.swagger.codegen.SupportingFile; import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; import io.swagger.models.Operation; public class JavaCXFClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures -{ - private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); + implements BeanValidationFeatures, UseGenericResponseFeatures, 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 @@ -34,6 +37,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen protected boolean useJaxbAnnotations = true; protected boolean useBeanValidation = false; + + protected boolean useGenericResponse = false; protected boolean useGzipFeatureForTests = false; @@ -75,7 +80,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen 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")); - + cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response")); } @@ -93,6 +98,14 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION); this.setUseBeanValidation(useBeanValidationProp); } + + if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { + this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE)); + } + + if (useGenericResponse) { + writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse); + } this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); @@ -132,6 +145,28 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen model.imports.remove("ToStringSerializer"); } + @Override + @SuppressWarnings("unchecked") + public Map postProcessOperations(Map objs) { + objs = super.postProcessOperations(objs); + + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + + if (operation.returnType == null) { + operation.returnType = "void"; + // set vendorExtensions.x-java-is-response-void to true as + // returnType is set to "void" + operation.vendorExtensions.put("x-java-is-response-void", true); + } + } + } + + return operations; + } + @Override public String getHelp() { @@ -155,4 +190,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen this.useLoggingFeatureForTests = useLoggingFeatureForTests; } + public void setUseGenericResponse(boolean useGenericResponse) { + this.useGenericResponse = useGenericResponse; + } + } 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 8c1b012ba62..4aa26394c6e 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 @@ -17,10 +17,11 @@ import io.swagger.codegen.languages.features.CXFServerFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; import io.swagger.models.Operation; public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen - implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures + implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures, UseGenericResponseFeatures { private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class); @@ -58,6 +59,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen protected boolean generateNonSpringApplication = false; + protected boolean useGenericResponse = false; + public JavaCXFServerCodegen() { super(); @@ -111,6 +114,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen cliOptions.add(CliOption.newBoolean(USE_ANNOTATED_BASE_PATH, "Use @Path annotations for basePath")); cliOptions.add(CliOption.newBoolean(GENERATE_NON_SPRING_APPLICATION, "Generate non-Spring application")); + cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response")); + } @@ -127,6 +132,14 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen if (additionalProperties.containsKey(ADD_CONSUMES_PRODUCES_JSON)) { this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON)); } + + if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { + this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE)); + } + + if (useGenericResponse) { + writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse); + } if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) { this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION)); @@ -306,5 +319,9 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen public void setGenerateNonSpringApplication(boolean generateNonSpringApplication) { this.generateNonSpringApplication = generateNonSpringApplication; } + + public void setUseGenericResponse(boolean useGenericResponse) { + this.useGenericResponse = useGenericResponse; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java new file mode 100644 index 00000000000..e4acbb9ca65 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java @@ -0,0 +1,9 @@ +package io.swagger.codegen.languages.features; + +public interface UseGenericResponseFeatures { + + // Language supports generating generic Jaxrs or native return types + public static final String USE_GENERIC_RESPONSE = "useGenericResponse"; + + public void setUseGenericResponse(boolean useGenericResponse); +} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index ea21a5635c1..d216ed02538 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -31,7 +31,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { // TODO: Implement... - {{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}} + {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}} } {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache index 85de81431b6..1746a84649c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache @@ -26,12 +26,16 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum } @Override +{{#jackson}} @JsonValue +{{/jackson}} public String toString() { return String.valueOf(value); } +{{#jackson}} @JsonCreator +{{/jackson}} 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)) { @@ -40,4 +44,5 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum } return null; } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache index c8f7a56938a..8e6066c8c84 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache @@ -1 +1,4 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +}}{{^useGenericResponse}}{{! +}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{! +}}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java index 6f6ed93084f..d48a2ccddea 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java @@ -4,6 +4,7 @@ import io.swagger.codegen.AbstractOptionsTest; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.languages.JavaCXFClientCodegen; import io.swagger.codegen.options.JavaCXFClientOptionsProvider; +import io.swagger.codegen.options.JavaCXFServerOptionsProvider; import io.swagger.codegen.options.OptionsProvider; import mockit.Expectations; import mockit.Tested; @@ -59,6 +60,9 @@ public class JaxrsCXFClientOptionsTest extends AbstractOptionsTest { clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_BEANVALIDATION)); times = 1; + clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE)); + times = 1; + clientCodegen.setUseLoggingFeatureForTests( Boolean.valueOf(JavaCXFClientOptionsProvider.USE_LOGGING_FEATURE_FOR_TESTS)); times = 1; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java index ef3de3a8900..aad1b0344e9 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java @@ -80,6 +80,8 @@ public class JaxrsCXFServerOptionsTest extends AbstractOptionsTest { clientCodegen.setUseBeanValidationFeature( Boolean.valueOf(JavaCXFServerOptionsProvider.USE_BEANVALIDATION_FEATURE)); times = 1; + clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFServerOptionsProvider.USE_GENERIC_RESPONSE)); + times = 1; clientCodegen.setGenerateSpringBootApplication( Boolean.valueOf(JavaCXFServerOptionsProvider.GENERATE_SPRING_BOOT_APPLICATION)); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java index afafd6ecf2f..d042e212da4 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java @@ -16,6 +16,8 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider { public static final String USE_LOGGING_FEATURE_FOR_TESTS = "true"; + public static final String USE_GENERIC_RESPONSE = "true"; + @Override public boolean isServer() { @@ -36,6 +38,7 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider { .putAll(parentOptions); builder.put(JavaCXFClientCodegen.USE_BEANVALIDATION, JavaCXFClientOptionsProvider.USE_BEANVALIDATION); + builder.put(JavaCXFClientCodegen.USE_GENERIC_RESPONSE, JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE); builder.put(JavaCXFClientCodegen.USE_JAXB_ANNOTATIONS, USE_JAXB_ANNOTATIONS); builder.put(JavaCXFClientCodegen.USE_GZIP_FEATURE_FOR_TESTS, USE_GZIP_FEATURE_FOR_TESTS); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java index f7cad3d6ccf..b343cdacb70 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java @@ -31,6 +31,8 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider { public static final String USE_BEANVALIDATION_FEATURE = "true"; + public static final String USE_GENERIC_RESPONSE = "true"; + public static final String USE_SPRING_ANNOTATION_CONFIG = "true"; public static final String GENERATE_SPRING_BOOT_APPLICATION = "true"; @@ -82,6 +84,7 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider { builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE, USE_LOGGING_FEATURE); builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE_FOR_TESTS, USE_LOGGING_FEATURE_FOR_TESTS); builder.put(JavaCXFServerCodegen.USE_BEANVALIDATION_FEATURE, USE_BEANVALIDATION_FEATURE); + builder.put(JavaCXFServerCodegen.USE_GENERIC_RESPONSE, USE_GENERIC_RESPONSE); builder.put(JavaCXFServerCodegen.GENERATE_SPRING_BOOT_APPLICATION, GENERATE_SPRING_BOOT_APPLICATION); diff --git a/samples/client/petstore/jaxrs-cxf/LICENSE b/samples/client/petstore/jaxrs-cxf/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/samples/client/petstore/jaxrs-cxf/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/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java new file mode 100644 index 00000000000..e904e888547 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.LocalDate; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; + +@Path("/") +@Api(value = "/", description = "") +public interface FakeApi { + + @PATCH + @Path("/fake") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test \"client\" model", tags={ }) + public Client testClientModel(Client body); + + @POST + @Path("/fake") + @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={ }) + 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); + + @GET + @Path("/fake") + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @ApiOperation(value = "To test enum parameters", tags={ }) + 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); +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index 4ff1aa826dc..73c002077a3 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -1,8 +1,8 @@ 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 java.io.InputStream; import java.io.OutputStream; @@ -15,11 +15,10 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface PetApi { @POST @@ -27,52 +26,51 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", tags={ }) - public void addPet(Pet body); + public void addPet(Pet body); @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", tags={ }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + 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={ }) - public List findPetsByStatus(@QueryParam("status")List status); + public List> findPetsByStatus(@QueryParam("status")List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ }) - public List findPetsByTags(@QueryParam("tags")List tags); + public List> findPetsByTags(@QueryParam("tags")List tags); @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find pet by ID", tags={ }) - public Pet getPetById(@PathParam("petId") Long petId); + public Pet getPetById(@PathParam("petId") Long petId); @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", tags={ }) - public void updatePet(Pet body); + public void updatePet(Pet body); @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updates a pet in the store with form data", tags={ }) - public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @ApiOperation(value = "uploads an image", tags={ }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, - @Multipart(value = "file" , required = false) Attachment fileDetail); + 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/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index dca146745e8..c162a456b28 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -13,35 +13,34 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface StoreApi { @DELETE @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", tags={ }) - public void deleteOrder(@PathParam("orderId") String orderId); + public void deleteOrder(@PathParam("orderId") String orderId); @GET @Path("/store/inventory") @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ }) - public Map getInventory(); + public Map> getInventory(); @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ }) - public Order getOrderById(@PathParam("orderId") Long orderId); + public Order getOrderById(@PathParam("orderId") Long orderId); @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", tags={ }) - public Order placeOrder(Order body); + public Order placeOrder(Order body); } diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index e3e77a12361..91dd35454ed 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -13,59 +13,58 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface UserApi { @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Create user", tags={ }) - public void createUser(User body); + 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={ }) - public void createUsersWithArrayInput(List body); + 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={ }) - public void createUsersWithListInput(List body); + public void createUsersWithListInput(List body); @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete user", tags={ }) - public void deleteUser(@PathParam("username") String username); + public void deleteUser(@PathParam("username") String username); @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", tags={ }) - public User getUserByName(@PathParam("username") String username); + public User getUserByName(@PathParam("username") String username); @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ }) - public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); + public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs out current logged in user session", tags={ }) - public void logoutUser(); + public void logoutUser(); @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", tags={ }) - public void updateUser(@PathParam("username") String username, User body); + public void updateUser(@PathParam("username") String username, User body); } diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..1f8f92829fa --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,90 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class AdditionalPropertiesClass { + + @ApiModelProperty(example = "null", value = "") + private Map mapProperty = new HashMap(); + @ApiModelProperty(example = "null", value = "") + private Map> mapOfMapProperty = new HashMap>(); + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + 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 mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..1b910d07fd8 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -0,0 +1,77 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Animal { + + @ApiModelProperty(example = "null", required = true, value = "") + private String className = null; + @ApiModelProperty(example = "null", value = "") + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..3605a9f929d --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,40 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class AnimalFarm extends ArrayList { + + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..0c503dd7905 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,65 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayOfArrayOfNumberOnly { + + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayNumber = new ArrayList>(); + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..d9715d924e0 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,65 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayOfNumberOnly { + + @ApiModelProperty(example = "null", value = "") + private List arrayNumber = new ArrayList(); + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..10d33ff8d46 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,115 @@ +package io.swagger.model; + +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayTest { + + @ApiModelProperty(example = "null", value = "") + private List arrayOfString = new ArrayList(); + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayOfInteger = new ArrayList>(); + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayOfModel = new ArrayList>(); + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..bedd5be84d1 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -0,0 +1,157 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Capitalization { + + @ApiModelProperty(example = "null", value = "") + private String smallCamel = null; + @ApiModelProperty(example = "null", value = "") + private String capitalCamel = null; + @ApiModelProperty(example = "null", value = "") + private String smallSnake = null; + @ApiModelProperty(example = "null", value = "") + private String capitalSnake = null; + @ApiModelProperty(example = "null", value = "") + private String scAETHFlowPoints = null; + @ApiModelProperty(example = "null", value = "Name of the pet ") + private String ATT_NAME = null; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java new file mode 100644 index 00000000000..d5a34f8cf60 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Cat extends Animal { + + @ApiModelProperty(example = "null", value = "") + private Boolean declawed = null; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index 591a6e22a69..152a402a980 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A category for a pet") public class Category { @ApiModelProperty(example = "null", value = "") @@ -26,9 +24,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 +41,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..19a210a6280 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,59 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model with \"_class\" property") +public class ClassModel { + + @ApiModelProperty(example = "null", value = "") + private String propertyClass = null; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..13f726f169a --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -0,0 +1,57 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Client { + + @ApiModelProperty(example = "null", value = "") + private String client = null; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..79d192044b9 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Dog extends Animal { + + @ApiModelProperty(example = "null", value = "") + private String breed = null; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..abd5edd8a11 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,150 @@ +package io.swagger.model; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class EnumArrays { + + +@XmlType(name="JustSymbolEnum") +@XmlEnum(String.class) +public enum JustSymbolEnum { + +@XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), @XmlEnumValue("$") DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JustSymbolEnum fromValue(String v) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private JustSymbolEnum justSymbol = null; + +@XmlType(name="ArrayEnumEnum") +@XmlEnum(String.class) +public enum ArrayEnumEnum { + +@XmlEnumValue("fish") FISH(String.valueOf("fish")), @XmlEnumValue("crab") CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ArrayEnumEnum fromValue(String v) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private List arrayEnum = new ArrayList(); + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..291878a42cd --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java @@ -0,0 +1,37 @@ +package io.swagger.model; + + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + 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/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..9bf0ed480d9 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -0,0 +1,217 @@ +package io.swagger.model; + +import io.swagger.model.OuterEnum; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class EnumTest { + + +@XmlType(name="EnumStringEnum") +@XmlEnum(String.class) +public enum EnumStringEnum { + +@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")), @XmlEnumValue("") EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringEnum fromValue(String v) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumStringEnum enumString = null; + +@XmlType(name="EnumIntegerEnum") +@XmlEnum(Integer.class) +public enum EnumIntegerEnum { + +@XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerEnum fromValue(String v) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumIntegerEnum enumInteger = null; + +@XmlType(name="EnumNumberEnum") +@XmlEnum(Double.class) +public enum EnumNumberEnum { + +@XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumNumberEnum fromValue(String v) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumNumberEnum enumNumber = null; + @ApiModelProperty(example = "null", value = "") + private OuterEnum outerEnum = null; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..7aaa680ee74 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -0,0 +1,310 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.UUID; +import org.joda.time.LocalDate; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class FormatTest { + + @ApiModelProperty(example = "null", value = "") + private Integer integer = null; + @ApiModelProperty(example = "null", value = "") + private Integer int32 = null; + @ApiModelProperty(example = "null", value = "") + private Long int64 = null; + @ApiModelProperty(example = "null", required = true, value = "") + private BigDecimal number = null; + @ApiModelProperty(example = "null", value = "") + private Float _float = null; + @ApiModelProperty(example = "null", value = "") + private Double _double = null; + @ApiModelProperty(example = "null", value = "") + private String string = null; + @ApiModelProperty(example = "null", required = true, value = "") + private byte[] _byte = null; + @ApiModelProperty(example = "null", value = "") + private byte[] binary = null; + @ApiModelProperty(example = "null", required = true, value = "") + private LocalDate date = null; + @ApiModelProperty(example = "null", value = "") + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + @ApiModelProperty(example = "null", value = "") + private UUID uuid = null; + @ApiModelProperty(example = "null", required = true, value = "") + private String password = null; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] binary) { + this.binary = binary; + } + + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..5217ab51d00 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,61 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class HasOnlyReadOnly { + + @ApiModelProperty(example = "null", value = "") + private String bar = null; + @ApiModelProperty(example = "null", value = "") + private String foo = null; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return 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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..c4a96d6e0cf --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -0,0 +1,123 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class MapTest { + + @ApiModelProperty(example = "null", value = "") + private Map> mapMapOfString = new HashMap>(); + +@XmlType(name="InnerEnum") +@XmlEnum(String.class) +public enum InnerEnum { + +@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InnerEnum fromValue(String v) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private Map mapOfEnumString = new HashMap(); + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + 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 mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..be9766ed322 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,107 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class MixedPropertiesAndAdditionalPropertiesClass { + + @ApiModelProperty(example = "null", value = "") + private UUID uuid = null; + @ApiModelProperty(example = "null", value = "") + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + @ApiModelProperty(example = "null", value = "") + private Map map = new HashMap(); + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..05fd797834c --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -0,0 +1,79 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model name starting with number") +public class Model200Response { + + @ApiModelProperty(example = "null", value = "") + private Integer name = null; + @ApiModelProperty(example = "null", value = "") + private String propertyClass = null; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index f3c6f56cfc4..c223c815449 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { @ApiModelProperty(example = "null", value = "") @@ -28,9 +26,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 +43,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 +60,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..92945ebdff6 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,59 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing reserved words") +public class ModelReturn { + + @ApiModelProperty(example = "null", value = "") + private Integer _return = null; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..874d6cf18bc --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -0,0 +1,103 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model name same as property name") +public class Name { + + @ApiModelProperty(example = "null", required = true, value = "") + private Integer name = null; + @ApiModelProperty(example = "null", value = "") + private Integer snakeCase = null; + @ApiModelProperty(example = "null", value = "") + private String property = null; + @ApiModelProperty(example = "null", value = "") + private Integer _123Number = null; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123Number + * @return _123Number + **/ + public Integer get123Number() { + return _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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..12b98f1cfa7 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class NumberOnly { + + @ApiModelProperty(example = "null", value = "") + private BigDecimal justNumber = null; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index af6f5e0e38e..121f73715b4 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="An order for a pets from the pet store") public class Order { @ApiModelProperty(example = "null", value = "") @@ -27,7 +25,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 +65,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 +82,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 +99,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 +116,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 +133,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 +150,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..29a009eabdd --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,37 @@ +package io.swagger.model; + + + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + 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/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 0cfc0a30ee0..5bca8a1291a 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; @@ -15,7 +14,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A pet for sale in the pet store") public class Pet { @ApiModelProperty(example = "null", value = "") @@ -33,7 +31,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 +69,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,9 +86,16 @@ 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 @@ -91,9 +103,16 @@ public enum StatusEnum { 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 @@ -101,9 +120,21 @@ public enum StatusEnum { 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 +142,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 +164,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..f4baea453a2 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,69 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ReadOnlyFirst { + + @ApiModelProperty(example = "null", value = "") + private String bar = null; + @ApiModelProperty(example = "null", value = "") + private String baz = null; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..afff9e4087e --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,57 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class SpecialModelName { + + @ApiModelProperty(example = "null", value = "") + private Long specialPropertyName = null; + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + public Long getSpecialPropertyName() { + return specialPropertyName; + } + + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + + @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 static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index 4eb99ad2fc1..fec9ab8820c 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A tag for a pet") public class Tag { @ApiModelProperty(example = "null", value = "") @@ -26,9 +24,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 +41,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index 005d9aa8c74..0b650614861 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A User who is purchasing from the pet store") public class User { @ApiModelProperty(example = "null", value = "") @@ -38,9 +36,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 +53,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 +70,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 +87,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 +104,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 +121,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 +138,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 +155,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(); diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java new file mode 100644 index 00000000000..5e8dae654a4 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java @@ -0,0 +1,146 @@ +/** + * 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. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.LocalDate; +import org.junit.Test; +import org.junit.Before; +import static org.junit.Assert.*; + +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.jaxrs.client.ClientConfiguration; +import org.apache.cxf.jaxrs.client.WebClient; + + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + + +/** + * API tests for FakeApi + */ +public class FakeApiTest { + + + private FakeApi api; + + @Before + public void setup() { + JacksonJsonProvider provider = new JacksonJsonProvider(); + List providers = new ArrayList(); + providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", FakeApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); + + ClientConfiguration config = WebClient.getConfig(client); + } + + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() { + Client body = null; + //Client response = api.testClientModel(body); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + byte[] binary = null; + LocalDate date = null; + 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); + + // TODO: test validations + + + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() { + List enumFormStringArray = null; + String enumFormString = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + // TODO: test validations + + + } + +} diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 9d4a9de9901..8aefa0bc820 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/client/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.*; @@ -80,9 +80,11 @@ public class PetApiTest { @Test public void addPetTest() { Pet body = null; - // response = api.addPet(body); - //assertNotNull(response); + //api.addPet(body); + // TODO: test validations + + } /** @@ -97,9 +99,11 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - // response = api.deletePet(petId, apiKey); - //assertNotNull(response); + //api.deletePet(petId, apiKey); + // TODO: test validations + + } /** @@ -113,9 +117,11 @@ public class PetApiTest { @Test public void findPetsByStatusTest() { List status = null; - //List response = api.findPetsByStatus(status); + //List> response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations + + } /** @@ -129,9 +135,11 @@ public class PetApiTest { @Test public void findPetsByTagsTest() { List tags = null; - //List response = api.findPetsByTags(tags); + //List> response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations + + } /** @@ -145,9 +153,11 @@ public class PetApiTest { @Test public void getPetByIdTest() { Long petId = null; - //Pet response = api.getPetById(petId); + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations + + } /** @@ -161,9 +171,11 @@ public class PetApiTest { @Test public void updatePetTest() { Pet body = null; - // response = api.updatePet(body); - //assertNotNull(response); + //api.updatePet(body); + // TODO: test validations + + } /** @@ -179,9 +191,11 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // response = api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //api.updatePetWithForm(petId, name, status); + // TODO: test validations + + } /** @@ -196,10 +210,12 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); //assertNotNull(response); // TODO: test validations + + } } diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index 81053a82b29..3f88aeb8e9d 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/client/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 @@ -78,9 +78,11 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - // response = api.deleteOrder(orderId); - //assertNotNull(response); + //api.deleteOrder(orderId); + // TODO: test validations + + } /** @@ -93,9 +95,11 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - //Map response = api.getInventory(); + //Map> response = api.getInventory(); //assertNotNull(response); // TODO: test validations + + } /** @@ -109,9 +113,11 @@ public class StoreApiTest { @Test public void getOrderByIdTest() { Long orderId = null; - //Order response = api.getOrderById(orderId); + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations + + } /** @@ -125,9 +131,11 @@ public class StoreApiTest { @Test public void placeOrderTest() { Order body = null; - //Order response = api.placeOrder(body); + //Order response = api.placeOrder(body); //assertNotNull(response); // TODO: test validations + + } } diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 126c7018935..ba69520279d 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/client/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 @@ -78,9 +78,11 @@ public class UserApiTest { @Test public void createUserTest() { User body = null; - // response = api.createUser(body); - //assertNotNull(response); + //api.createUser(body); + // TODO: test validations + + } /** @@ -94,9 +96,11 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() { List body = null; - // response = api.createUsersWithArrayInput(body); - //assertNotNull(response); + //api.createUsersWithArrayInput(body); + // TODO: test validations + + } /** @@ -110,9 +114,11 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() { List body = null; - // response = api.createUsersWithListInput(body); - //assertNotNull(response); + //api.createUsersWithListInput(body); + // TODO: test validations + + } /** @@ -126,9 +132,11 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - // response = api.deleteUser(username); - //assertNotNull(response); + //api.deleteUser(username); + // TODO: test validations + + } /** @@ -142,9 +150,11 @@ public class UserApiTest { @Test public void getUserByNameTest() { String username = null; - //User response = api.getUserByName(username); + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations + + } /** @@ -159,9 +169,11 @@ public class UserApiTest { public void loginUserTest() { String username = null; String password = null; - //String response = api.loginUser(username, password); + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations + + } /** @@ -174,9 +186,11 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - // response = api.logoutUser(); - //assertNotNull(response); + //api.logoutUser(); + // TODO: test validations + + } /** @@ -191,9 +205,11 @@ public class UserApiTest { public void updateUserTest() { String username = null; User body = null; - // response = api.updateUser(username, body); - //assertNotNull(response); + //api.updateUser(username, body); + // TODO: test validations + + } } diff --git a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore index c5fa491b4c5..70b88e71039 100644 --- a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +**/impl/* \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java index 5f4f359b6d9..928ecf719c8 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java @@ -37,5 +37,6 @@ public enum EnumClass { } return null; } + } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java index 1a2f5bbac54..a95e0f4f052 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java @@ -37,5 +37,6 @@ public enum OuterEnum { } return null; } + } 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 188fdb7b5cf..444c595b78e 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 @@ -80,7 +80,7 @@ public class PetApiTest { @Test public void addPetTest() { Pet body = null; - //api.addPet(body); + //api.addPet(body); // TODO: test validations @@ -99,7 +99,7 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - //api.deletePet(petId, apiKey); + //api.deletePet(petId, apiKey); // TODO: test validations @@ -153,7 +153,7 @@ public class PetApiTest { @Test public void getPetByIdTest() { Long petId = null; - //Pet response = api.getPetById(petId); + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations @@ -171,7 +171,7 @@ public class PetApiTest { @Test public void updatePetTest() { Pet body = null; - //api.updatePet(body); + //api.updatePet(body); // TODO: test validations @@ -191,7 +191,7 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - //api.updatePetWithForm(petId, name, status); + //api.updatePetWithForm(petId, name, status); // TODO: test validations @@ -211,7 +211,7 @@ public class PetApiTest { Long petId = null; String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); //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 aa476b0cf0f..c0cd10dca71 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 @@ -79,7 +79,7 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - //api.deleteOrder(orderId); + //api.deleteOrder(orderId); // TODO: test validations @@ -114,7 +114,7 @@ public class StoreApiTest { @Test public void getOrderByIdTest() { Long orderId = null; - //Order response = api.getOrderById(orderId); + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations @@ -132,7 +132,7 @@ public class StoreApiTest { @Test public void placeOrderTest() { Order body = null; - //Order response = api.placeOrder(body); + //Order response = api.placeOrder(body); //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 76bb7fa5578..2d1481bde34 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 @@ -79,7 +79,7 @@ public class UserApiTest { @Test public void createUserTest() { User body = null; - //api.createUser(body); + //api.createUser(body); // TODO: test validations @@ -97,7 +97,7 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() { List body = null; - //api.createUsersWithArrayInput(body); + //api.createUsersWithArrayInput(body); // TODO: test validations @@ -115,7 +115,7 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() { List body = null; - //api.createUsersWithListInput(body); + //api.createUsersWithListInput(body); // TODO: test validations @@ -133,7 +133,7 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - //api.deleteUser(username); + //api.deleteUser(username); // TODO: test validations @@ -151,7 +151,7 @@ public class UserApiTest { @Test public void getUserByNameTest() { String username = null; - //User response = api.getUserByName(username); + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations @@ -170,7 +170,7 @@ public class UserApiTest { public void loginUserTest() { String username = null; String password = null; - //String response = api.loginUser(username, password); + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations @@ -187,7 +187,7 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - //api.logoutUser(); + //api.logoutUser(); // TODO: test validations @@ -206,7 +206,7 @@ public class UserApiTest { public void updateUserTest() { String username = null; User body = null; - //api.updateUser(username, body); + //api.updateUser(username, body); // TODO: test validations From 071c012f859bae49fabbc6d6d61d49ceb071ae59 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Apr 2017 16:05:40 +0800 Subject: [PATCH 09/13] Replace tab with 4 space in Java files (#5298) * replace tab with 4 space in java files * revise error message in shell script * print result before checking * revise grep expression --- bin/utils/detect_tab_in_java_class.sh | 8 +- .../io/swagger/codegen/CodegenParameter.java | 66 +++++----- .../io/swagger/codegen/CodegenProperty.java | 8 +- .../io/swagger/codegen/auth/AuthParser.java | 6 +- .../languages/AbstractCSharpCodegen.java | 24 ++-- .../languages/CSharpClientCodegen.java | 2 +- .../TypeScriptAngularClientCodegen.java | 56 ++++----- .../codegen/InlineModelResolverTest.java | 40 +++--- .../languages/JavaClientCodegenTest.java | 116 +++++++++--------- .../AspNetCoreServerOptionsProvider.java | 2 +- 10 files changed, 163 insertions(+), 165 deletions(-) diff --git a/bin/utils/detect_tab_in_java_class.sh b/bin/utils/detect_tab_in_java_class.sh index 8d612acd2e0..21be867ff4e 100755 --- a/bin/utils/detect_tab_in_java_class.sh +++ b/bin/utils/detect_tab_in_java_class.sh @@ -1,10 +1,12 @@ #!/bin/bash # grep for \t in the generators -grep -RUIl $'\t$' modules/swagger-codegen/src/main/java/io/swagger/codegen/*.java +RESULT=`find modules/swagger-codegen/src/ -name "*.java" | xargs grep $'\t'` -if [ $? -ne 1 ]; then - echo "Generators (Java class files) contain tab '/t'. Please remove it and try again." +echo -e "$RESULT" + +if [ "$RESULT" != "" ]; then + echo "Java files contain tab '\\t'. Please remove it and try again." exit 1; fi 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 db0464ba7bd..43a3abce0a1 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 @@ -34,49 +34,49 @@ public class CodegenParameter { */ public boolean required; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17. - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor17. + */ public String maximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor17 + */ public boolean exclusiveMaximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor21 + */ public String minimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor21 + */ public boolean exclusiveMinimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor26 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor26 + */ public Integer maxLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor29 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor29 + */ public Integer minLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor33 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor33 + */ public String pattern; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor42 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor42 + */ public Integer maxItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor45 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor45 + */ public Integer minItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor49 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor49 + */ public boolean uniqueItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor14 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor14 + */ public Number multipleOf; public CodegenParameter copy() { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java index de6ebb715f2..b5e383a617b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java @@ -306,8 +306,8 @@ public class CodegenProperty implements Cloneable { @Override public CodegenProperty clone() { try { - CodegenProperty cp = (CodegenProperty) super.clone(); - if (this._enum != null) { + CodegenProperty cp = (CodegenProperty) super.clone(); + if (this._enum != null) { cp._enum = new ArrayList(this._enum); } if (this.allowableValues != null) { @@ -316,10 +316,10 @@ public class CodegenProperty implements Cloneable { if (this.items != null) { cp.items = this.items; } - if(this.vendorExtensions != null){ + if(this.vendorExtensions != null){ cp.vendorExtensions = new HashMap(this.vendorExtensions); } - return cp; + return cp; } catch (CloneNotSupportedException e) { throw new IllegalStateException(e); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java index 65896dc5933..8f46cd9f699 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java @@ -15,7 +15,7 @@ import config.ConfigParser; import static org.apache.commons.lang3.StringUtils.isNotEmpty; public class AuthParser { - + private static final Logger LOGGER = LoggerFactory.getLogger(AuthParser.class); public static List parse(String urlEncodedAuthStr) { @@ -25,7 +25,8 @@ public class AuthParser { for (String part : parts) { String[] kvPair = part.split(":"); if (kvPair.length == 2) { - auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ? + // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ? + auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); } } } @@ -53,5 +54,4 @@ public class AuthParser { return null; } } - } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index e9259a4b3f4..f996879c07b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -614,24 +614,24 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } public void setPackageTitle(String packageTitle) { - this.packageTitle = packageTitle; - } + this.packageTitle = packageTitle; + } public void setPackageProductName(String packageProductName) { - this.packageProductName = packageProductName; - } + this.packageProductName = packageProductName; + } - public void setPackageDescription(String packageDescription) { - this.packageDescription = packageDescription; - } - + public void setPackageDescription(String packageDescription) { + this.packageDescription = packageDescription; + } + public void setPackageCompany(String packageCompany) { - this.packageCompany = packageCompany; - } + this.packageCompany = packageCompany; + } public void setPackageCopyright(String packageCopyright) { - this.packageCopyright = packageCopyright; - } + this.packageCopyright = packageCopyright; + } public void setSourceFolder(String sourceFolder) { this.sourceFolder = sourceFolder; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index b5bd88db1d7..103e0100d91 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -425,7 +425,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @Override public Map postProcessModels(Map objMap) { - return super.postProcessModels(objMap); + return super.postProcessModels(objMap); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 18c6f72e9cb..8c042f1220b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java @@ -8,39 +8,39 @@ import io.swagger.models.properties.Property; public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCodegen { - @Override - public String getName() { - return "typescript-angular"; - } + @Override + public String getName() { + return "typescript-angular"; + } - @Override - public String getHelp() { - return "Generates a TypeScript AngularJS client library."; - } + @Override + public String getHelp() { + return "Generates a TypeScript AngularJS client library."; + } - @Override - public void processOpts() { - super.processOpts(); - supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts")); + @Override + public void processOpts() { + super.processOpts(); + supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts")); supportingFiles.add(new SupportingFile("apis.mustache", apiPackage().replace('.', File.separatorChar), "api.ts")); supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts")); supportingFiles.add(new SupportingFile("api.module.mustache", getIndexDirectory(), "api.module.ts")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); - } - - public TypeScriptAngularClientCodegen() { - super(); - outputFolder = "generated-code/typescript-angular"; - modelTemplateFiles.put("model.mustache", ".ts"); + } + + public TypeScriptAngularClientCodegen() { + super(); + outputFolder = "generated-code/typescript-angular"; + modelTemplateFiles.put("model.mustache", ".ts"); apiTemplateFiles.put("api.mustache", ".ts"); - embeddedTemplateDir = templateDir = "typescript-angular"; - apiPackage = "api"; + embeddedTemplateDir = templateDir = "typescript-angular"; + apiPackage = "api"; modelPackage = "model"; - } + } - @Override + @Override public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); if(isLanguagePrimitive(swaggerType) || isLanguageGenericType(swaggerType)) { @@ -49,18 +49,18 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return addModelPrefix(swaggerType); } - @Override + @Override public void postProcessParameter(CodegenParameter parameter) { super.postProcessParameter(parameter); parameter.dataType = addModelPrefix(parameter.dataType); } - private String getIndexDirectory() { + private String getIndexDirectory() { String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.'))); return indexPackage.replace('.', File.separatorChar); } - private String addModelPrefix(String swaggerType) { + private String addModelPrefix(String swaggerType) { String type = null; if (typeMapping.containsKey(swaggerType)) { type = typeMapping.get(swaggerType); @@ -74,7 +74,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return type; } - private boolean isLanguagePrimitive(String type) { + private boolean isLanguagePrimitive(String type) { return languageSpecificPrimitives.contains(type); } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java index 6b9c3a3c5b1..ff69e4b36bf 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java @@ -1,6 +1,5 @@ package io.swagger.codegen; - import io.swagger.models.*; import io.swagger.models.parameters.BodyParameter; import io.swagger.models.parameters.Parameter; @@ -161,7 +160,7 @@ public class InlineModelResolverTest { .name("name") .property("street", new StringProperty()) .property("city", new StringProperty()) - .property("apartment", new StringProperty()))); + .property("apartment", new StringProperty()))); new InlineModelResolver().flatten(swagger); @@ -206,7 +205,7 @@ public class InlineModelResolverTest { Response response = responses.get("200"); assertNotNull(response); Property schema = response.getSchema(); - assertTrue(schema instanceof RefProperty); + assertTrue(schema instanceof RefProperty); assertEquals(1, schema.getVendorExtensions().size()); assertEquals("ext-prop", schema.getVendorExtensions().get("x-ext")); @@ -222,7 +221,7 @@ public class InlineModelResolverTest { Swagger swagger = new Swagger(); String responseTitle = "GetBarResponse"; - swagger.path("/foo/bar", new Path() + swagger.path("/foo/bar", new Path() .get(new Operation() .response(200, new Response() .description("it works!") @@ -336,8 +335,8 @@ public class InlineModelResolverTest { ModelImpl addressModelItem = new ModelImpl(); String addressModelName = "DetailedAddress"; - addressModelItem.setTitle(addressModelName); - swagger.path("/hello", new Path() + addressModelItem.setTitle(addressModelName); + swagger.path("/hello", new Path() .get(new Operation() .parameter(new BodyParameter() .name("body") @@ -436,12 +435,12 @@ public class InlineModelResolverTest { public void resolveInlineArrayResponse() throws Exception { Swagger swagger = new Swagger(); - ArrayProperty schema = new ArrayProperty() - .items(new ObjectProperty() - .property("name", new StringProperty()) - .vendorExtension("x-ext", "ext-items")) - .vendorExtension("x-ext", "ext-prop"); - swagger.path("/foo/baz", new Path() + ArrayProperty schema = new ArrayProperty() + .items(new ObjectProperty() + .property("name", new StringProperty()) + .vendorExtension("x-ext", "ext-items")) + .vendorExtension("x-ext", "ext-prop"); + swagger.path("/foo/baz", new Path() .get(new Operation() .response(200, new Response() .vendorExtension("x-foo", "bar") @@ -487,15 +486,14 @@ public class InlineModelResolverTest { Swagger swagger = new Swagger(); swagger.path("/foo/baz", new Path() - .get(new Operation() - .response(200, new Response() - .vendorExtension("x-foo", "bar") - .description("it works!") - .schema(new ArrayProperty() - .items( - new ObjectProperty() - .title("FooBar") - .property("name", new StringProperty())))))); + .get(new Operation() + .response(200, new Response() + .vendorExtension("x-foo", "bar") + .description("it works!") + .schema(new ArrayProperty() + .items(new ObjectProperty() + .title("FooBar") + .property("name", new StringProperty())))))); new InlineModelResolver().flatten(swagger); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java index 2dceedacf93..e761f2ec088 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java @@ -10,70 +10,68 @@ import org.testng.Assert; import org.testng.annotations.Test; public class JavaClientCodegenTest { - - private static final String VENDOR_MIME_TYPE = "application/vnd.company.v1+json"; - private static final String XML_MIME_TYPE = "application/xml"; - private static final String JSON_MIME_TYPE = "application/json"; - private static final String TEXT_MIME_TYPE = "text/plain"; - @Test - public void testJsonMime() { - Assert.assertTrue(JavaClientCodegen.isJsonMimeType(JSON_MIME_TYPE)); - Assert.assertFalse(JavaClientCodegen.isJsonMimeType(XML_MIME_TYPE)); - Assert.assertFalse(JavaClientCodegen.isJsonMimeType(TEXT_MIME_TYPE)); - - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.v1+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeA.version1+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeB.version2+json")); - Assert.assertFalse(JavaClientCodegen.isJsonVendorMimeType("application/v.json")); - - } - - @Test - public void testContentTypePrioritization() { - Map jsonMimeType = new HashMap<>(); - jsonMimeType.put(JavaClientCodegen.MEDIA_TYPE, JSON_MIME_TYPE); + private static final String VENDOR_MIME_TYPE = "application/vnd.company.v1+json"; + private static final String XML_MIME_TYPE = "application/xml"; + private static final String JSON_MIME_TYPE = "application/json"; + private static final String TEXT_MIME_TYPE = "text/plain"; - Map xmlMimeType = new HashMap<>(); - xmlMimeType.put(JavaClientCodegen.MEDIA_TYPE, XML_MIME_TYPE); + @Test + public void testJsonMime() { + Assert.assertTrue(JavaClientCodegen.isJsonMimeType(JSON_MIME_TYPE)); + Assert.assertFalse(JavaClientCodegen.isJsonMimeType(XML_MIME_TYPE)); + Assert.assertFalse(JavaClientCodegen.isJsonMimeType(TEXT_MIME_TYPE)); - Map vendorMimeType = new HashMap<>(); - vendorMimeType.put(JavaClientCodegen.MEDIA_TYPE, VENDOR_MIME_TYPE); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.v1+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeA.version1+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeB.version2+json")); + Assert.assertFalse(JavaClientCodegen.isJsonVendorMimeType("application/v.json")); - Map textMimeType = new HashMap<>(); - textMimeType.put(JavaClientCodegen.MEDIA_TYPE, TEXT_MIME_TYPE); + } - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes( - Collections.>emptyList()), Collections.emptyList()); + @Test + public void testContentTypePrioritization() { + Map jsonMimeType = new HashMap<>(); + jsonMimeType.put(JavaClientCodegen.MEDIA_TYPE, JSON_MIME_TYPE); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType)), Arrays.asList(xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType)); + Map xmlMimeType = new HashMap<>(); + xmlMimeType.put(JavaClientCodegen.MEDIA_TYPE, XML_MIME_TYPE); - - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)), - Arrays.asList(jsonMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)), - Arrays.asList(jsonMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, vendorMimeType)), - Arrays.asList(vendorMimeType, jsonMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(textMimeType, xmlMimeType)), - Arrays.asList(textMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, textMimeType)), - Arrays.asList(xmlMimeType, textMimeType)); - - System.out.println(JavaClientCodegen.prioritizeContentTypes(Arrays.asList( - xmlMimeType,textMimeType, jsonMimeType, vendorMimeType))); - - List> priContentTypes = JavaClientCodegen.prioritizeContentTypes(Arrays.asList( - xmlMimeType, textMimeType, jsonMimeType, vendorMimeType)); - Assert.assertEquals(priContentTypes, Arrays.asList(vendorMimeType, jsonMimeType, xmlMimeType, textMimeType)); - - for ( int i = 0; i < 3; i++ ) - Assert.assertNotNull(priContentTypes.get(i).get("hasMore")); - Assert.assertNull(priContentTypes.get(3).get("hasMore")); - - } - + Map vendorMimeType = new HashMap<>(); + vendorMimeType.put(JavaClientCodegen.MEDIA_TYPE, VENDOR_MIME_TYPE); + + Map textMimeType = new HashMap<>(); + textMimeType.put(JavaClientCodegen.MEDIA_TYPE, TEXT_MIME_TYPE); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes( + Collections.>emptyList()), Collections.emptyList()); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType)), Arrays.asList(xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType)); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)), + Arrays.asList(jsonMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)), + Arrays.asList(jsonMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, vendorMimeType)), + Arrays.asList(vendorMimeType, jsonMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(textMimeType, xmlMimeType)), + Arrays.asList(textMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, textMimeType)), + Arrays.asList(xmlMimeType, textMimeType)); + + System.out.println(JavaClientCodegen.prioritizeContentTypes(Arrays.asList( + xmlMimeType,textMimeType, jsonMimeType, vendorMimeType))); + + List> priContentTypes = JavaClientCodegen.prioritizeContentTypes(Arrays.asList( + xmlMimeType, textMimeType, jsonMimeType, vendorMimeType)); + Assert.assertEquals(priContentTypes, Arrays.asList(vendorMimeType, jsonMimeType, xmlMimeType, textMimeType)); + + for ( int i = 0; i < 3; i++ ) + Assert.assertNotNull(priContentTypes.get(i).get("hasMore")); + + Assert.assertNull(priContentTypes.get(3).get("hasMore")); + } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java index 2633702d112..5c415e84a1f 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java @@ -10,7 +10,7 @@ public class AspNetCoreServerOptionsProvider implements OptionsProvider { public static final String PACKAGE_NAME_VALUE = "swagger_server_aspnetcore"; public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String SOURCE_FOLDER_VALUE = "src_aspnetcore"; - + @Override public String getLanguage() { return "aspnetcore"; From ce41a343d8327e6af2c24310e33454174c8d19a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 2 Apr 2017 11:01:15 +0200 Subject: [PATCH 10/13] Updating all samples (except feign) (#5281) --- samples/client/petstore/bash/_petstore-cli | 4 +-- samples/client/petstore/bash/petstore-cli | 28 +++++++++---------- .../bash/petstore-cli.bash-completion | 4 +-- .../csharp/SwaggerClient.v5/README.md | 4 +-- .../csharp/SwaggerClient.v5/docs/StoreApi.md | 4 +-- .../src/IO.Swagger/Api/StoreApi.cs | 8 +++--- .../petstore/csharp/SwaggerClient/README.md | 4 +-- .../csharp/SwaggerClient/docs/StoreApi.md | 4 +-- .../src/IO.Swagger/Api/StoreApi.cs | 16 +++++------ .../README.md | 4 +-- .../docs/StoreApi.md | 4 +-- .../src/IO.Swagger/Api/StoreApi.cs | 16 +++++------ .../client/petstore/go/go-petstore/README.md | 4 +-- .../petstore/go/go-petstore/docs/StoreApi.md | 4 +-- .../petstore/go/go-petstore/store_api.go | 8 +++--- .../petstore/java/jersey1/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/jersey2-java8/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../docs/StoreApi.md | 4 +-- .../java/io/swagger/client/ApiClient.java | 5 ++-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/okhttp-gson/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/io/swagger/client/api/StoreApi.java | 16 +++++------ .../java/retrofit2-play24/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../petstore/java/retrofit2/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/retrofit2rx/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../java/retrofit2rx2/docs/StoreApi.md | 4 +-- .../java/io/swagger/client/api/StoreApi.java | 8 +++--- .../petstore/javascript-promise/README.md | 4 +-- .../javascript-promise/docs/StoreApi.md | 4 +-- .../javascript-promise/src/api/StoreApi.js | 8 +++--- samples/client/petstore/javascript/README.md | 4 +-- .../petstore/javascript/docs/StoreApi.md | 4 +-- .../petstore/javascript/src/api/StoreApi.js | 8 +++--- samples/client/petstore/perl/README.md | 4 +-- samples/client/petstore/perl/docs/StoreApi.md | 4 +-- .../perl/lib/WWW/SwaggerClient/StoreApi.pm | 8 +++--- .../petstore/php/SwaggerClient-php/README.md | 4 +-- .../SwaggerClient-php/docs/Api/StoreApi.md | 4 +-- .../SwaggerClient-php/lib/Api/StoreApi.php | 12 ++++---- samples/client/petstore/python/README.md | 4 +-- .../client/petstore/python/docs/StoreApi.md | 4 +-- .../python/petstore_api/apis/store_api.py | 8 +++--- samples/client/petstore/ruby/README.md | 4 +-- samples/client/petstore/ruby/docs/StoreApi.md | 4 +-- .../ruby/lib/petstore/api/store_api.rb | 4 +-- .../Classes/Swaggers/APIs/StoreAPI.swift | 8 +++--- .../Classes/Swaggers/APIs/StoreAPI.swift | 8 +++--- .../Classes/Swaggers/APIs/StoreAPI.swift | 8 +++--- .../petstore/typescript-node/default/api.ts | 4 +-- .../petstore/typescript-node/npm/api.ts | 4 +-- .../src/main/swagger/swagger.yaml | 6 ++-- .../src/gen/java/io/swagger/api/StoreApi.java | 8 +++--- .../src/gen/java/io/swagger/api/StoreApi.java | 8 +++--- .../src/gen/java/io/swagger/api/StoreApi.java | 8 +++--- .../server/petstore/jaxrs-spec/swagger.json | 6 ++-- .../petstore/lumen/lib/app/Http/routes.php | 4 +-- .../api/swagger.yaml | 2 +- .../server/petstore/nodejs/api/swagger.yaml | 2 +- .../main/java/io/swagger/api/StoreApi.java | 8 +++--- .../io/swagger/api/StoreApiController.java | 4 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +++--- .../io/swagger/api/StoreApiController.java | 4 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +++--- .../io/swagger/api/StoreApiController.java | 4 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +++--- .../io/swagger/api/StoreApiController.java | 4 +-- 72 files changed, 227 insertions(+), 226 deletions(-) diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index 829e500ba2a..8552bad11ce 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -406,7 +406,7 @@ case $state in deleteOrder) local -a _op_arguments _op_arguments=( - "orderId=:[PATH] ID of the order that needs to be deleted" + "order_id=:[PATH] ID of the order that needs to be deleted" ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; @@ -419,7 +419,7 @@ case $state in getOrderById) local -a _op_arguments _op_arguments=( - "orderId=:[PATH] ID of pet that needs to be fetched" + "order_id=:[PATH] ID of pet that needs to be fetched" ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 8490704434f..ad3c33d353b 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -102,8 +102,8 @@ operation_parameters_minimum_occurences["updatePetWithForm:::status"]=0 operation_parameters_minimum_occurences["uploadFile:::petId"]=1 operation_parameters_minimum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_minimum_occurences["uploadFile:::file"]=0 -operation_parameters_minimum_occurences["deleteOrder:::orderId"]=1 -operation_parameters_minimum_occurences["getOrderById:::orderId"]=1 +operation_parameters_minimum_occurences["deleteOrder:::order_id"]=1 +operation_parameters_minimum_occurences["getOrderById:::order_id"]=1 operation_parameters_minimum_occurences["placeOrder:::body"]=1 operation_parameters_minimum_occurences["createUser:::body"]=1 operation_parameters_minimum_occurences["createUsersWithArrayInput:::body"]=1 @@ -158,8 +158,8 @@ operation_parameters_maximum_occurences["updatePetWithForm:::status"]=0 operation_parameters_maximum_occurences["uploadFile:::petId"]=0 operation_parameters_maximum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_maximum_occurences["uploadFile:::file"]=0 -operation_parameters_maximum_occurences["deleteOrder:::orderId"]=0 -operation_parameters_maximum_occurences["getOrderById:::orderId"]=0 +operation_parameters_maximum_occurences["deleteOrder:::order_id"]=0 +operation_parameters_maximum_occurences["getOrderById:::order_id"]=0 operation_parameters_maximum_occurences["placeOrder:::body"]=0 operation_parameters_maximum_occurences["createUser:::body"]=0 operation_parameters_maximum_occurences["createUsersWithArrayInput:::body"]=0 @@ -211,8 +211,8 @@ operation_parameters_collection_type["updatePetWithForm:::status"]="" operation_parameters_collection_type["uploadFile:::petId"]="" operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" operation_parameters_collection_type["uploadFile:::file"]="" -operation_parameters_collection_type["deleteOrder:::orderId"]="" -operation_parameters_collection_type["getOrderById:::orderId"]="" +operation_parameters_collection_type["deleteOrder:::order_id"]="" +operation_parameters_collection_type["getOrderById:::order_id"]="" operation_parameters_collection_type["placeOrder:::body"]="" operation_parameters_collection_type["createUser:::body"]="" operation_parameters_collection_type["createUsersWithArrayInput:::body"]= @@ -1390,7 +1390,7 @@ print_deleteOrder_help() { echo -e "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" | fold -sw 80 echo -e "" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" - echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" case 400 in @@ -1480,7 +1480,7 @@ print_getOrderById_help() { echo -e "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" | fold -sw 80 echo -e "" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" - echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" case 200 in @@ -2469,14 +2469,14 @@ call_uploadFile() { # ############################################################################## call_deleteOrder() { - local path_parameter_names=(orderId) + local path_parameter_names=(order_id) local query_parameter_names=() if [[ $force = false ]]; then - validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names + validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names fi - local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) + local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names) local method="DELETE" local headers_curl=$(header_arguments_to_curl) if [[ -n $header_accept ]]; then @@ -2531,14 +2531,14 @@ call_getInventory() { # ############################################################################## call_getOrderById() { - local path_parameter_names=(orderId) + local path_parameter_names=(order_id) local query_parameter_names=() if [[ $force = false ]]; then - validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names + validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names fi - local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) + local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names) local method="GET" local headers_curl=$(header_arguments_to_curl) if [[ -n $header_accept ]]; then diff --git a/samples/client/petstore/bash/petstore-cli.bash-completion b/samples/client/petstore/bash/petstore-cli.bash-completion index 6b05bd0a97f..249f1a102cc 100644 --- a/samples/client/petstore/bash/petstore-cli.bash-completion +++ b/samples/client/petstore/bash/petstore-cli.bash-completion @@ -106,9 +106,9 @@ _petstore-cli() operation_parameters["updatePet"]="" operation_parameters["updatePetWithForm"]="petId= " operation_parameters["uploadFile"]="petId= " - operation_parameters["deleteOrder"]="orderId= " + operation_parameters["deleteOrder"]="order_id= " operation_parameters["getInventory"]="" - operation_parameters["getOrderById"]="orderId= " + operation_parameters["getOrderById"]="order_id= " operation_parameters["placeOrder"]="" operation_parameters["createUser"]="" operation_parameters["createUsersWithArrayInput"]="" diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/README.md b/samples/client/petstore/csharp/SwaggerClient.v5/README.md index cb19e7d8714..d56551bfcbc 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/README.md +++ b/samples/client/petstore/csharp/SwaggerClient.v5/README.md @@ -84,9 +84,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs index a44e000b6cc..18dccb27f2f 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs @@ -241,7 +241,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -263,7 +263,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -376,7 +376,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -398,7 +398,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 8b269fdd760..e7e5c9fb849 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -104,9 +104,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet 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 809f16f7239..32d01eded1c 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 @@ -325,7 +325,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -347,7 +347,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -393,7 +393,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -415,7 +415,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -595,7 +595,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -617,7 +617,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -664,7 +664,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -686,7 +686,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 8b269fdd760..e7e5c9fb849 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -104,9 +104,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet 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 809f16f7239..32d01eded1c 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 @@ -325,7 +325,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -347,7 +347,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -393,7 +393,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -415,7 +415,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -595,7 +595,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -617,7 +617,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -664,7 +664,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -686,7 +686,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 15f3ca6f4aa..90c83d951c7 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -32,9 +32,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index f7d52eb2b9d..cf0f657465e 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 7f136f31f2d..0e46b54beec 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -48,8 +48,8 @@ func (a StoreApi) DeleteOrder(orderId string) (*APIResponse, error) { var localVarHttpMethod = strings.ToUpper("Delete") // create path and map variables - localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" - localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath := a.Configuration.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -170,8 +170,8 @@ func (a StoreApi) GetOrderById(orderId int64) (*Order, *APIResponse, error) { var localVarHttpMethod = strings.ToUpper("Get") // create path and map variables - localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" - localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath := a.Configuration.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/samples/client/petstore/java/jersey1/docs/StoreApi.md b/samples/client/petstore/java/jersey1/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey1/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey1/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 48d7c58de7b..db18bcb589f 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,8 +63,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -140,8 +140,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 d0a1e843743..22be0ebb027 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,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 59b054e31c9..c39625501fc 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 @@ -727,12 +727,13 @@ public class ApiClient { * application/json * application/json; charset=UTF8 * APPLICATION/JSON - * + * application/vnd.company+json * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - return mime != null && mime.matches("(?i)application\\/json(;.*)?"); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && mime.matches(jsonMime); } /** 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 0b9fc0c48c1..0b1d4c12323 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 @@ -66,8 +66,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -304,8 +304,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 0b9fc0c48c1..0b1d4c12323 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 @@ -66,8 +66,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -304,8 +304,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index 7dba9b5d855..f705411a0df 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,9 +22,9 @@ public interface StoreApi { * @return Void */ - @DELETE("/store/order/{orderId}") + @DELETE("/store/order/{order_id}") Void deleteOrder( - @retrofit.http.Path("orderId") String orderId + @retrofit.http.Path("order_id") String orderId ); /** @@ -34,9 +34,9 @@ public interface StoreApi { * @param cb callback method */ - @DELETE("/store/order/{orderId}") + @DELETE("/store/order/{order_id}") void deleteOrder( - @retrofit.http.Path("orderId") String orderId, Callback cb + @retrofit.http.Path("order_id") String orderId, Callback cb ); /** * Returns pet inventories by status @@ -67,9 +67,9 @@ public interface StoreApi { * @return Order */ - @GET("/store/order/{orderId}") + @GET("/store/order/{order_id}") Order getOrderById( - @retrofit.http.Path("orderId") Long orderId + @retrofit.http.Path("order_id") Long orderId ); /** @@ -79,9 +79,9 @@ public interface StoreApi { * @param cb callback method */ - @GET("/store/order/{orderId}") + @GET("/store/order/{order_id}") void getOrderById( - @retrofit.http.Path("orderId") Long orderId, Callback cb + @retrofit.http.Path("order_id") Long orderId, Callback cb ); /** * Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet 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 94877ed3890..3cfefc29b9d 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 @@ -26,9 +26,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") F.Promise> deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -46,9 +46,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") F.Promise> getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet 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 16b57ea3c90..3be2674aa76 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 @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Call deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Call getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet 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 a937daca7cc..c2dc749a331 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 @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Observable deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java index a937daca7cc..c2dc749a331 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Observable deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 73aa0e9763a..ab8caef7b02 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -82,9 +82,9 @@ Class | Method | HTTP request | Description *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/javascript-promise/docs/StoreApi.md b/samples/client/petstore/javascript-promise/docs/StoreApi.md index a7ec557dcef..402c198e817 100644 --- a/samples/client/petstore/javascript-promise/docs/StoreApi.md +++ b/samples/client/petstore/javascript-promise/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 987f5c0bdb2..eb623403815 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -62,7 +62,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -77,7 +77,7 @@ var returnType = null; return this.apiClient.callApi( - '/store/order/{orderId}', 'DELETE', + '/store/order/{order_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); @@ -156,7 +156,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -171,7 +171,7 @@ var returnType = Order; return this.apiClient.callApi( - '/store/order/{orderId}', 'GET', + '/store/order/{order_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 6e99bc5392b..065bf4f1ca4 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -85,9 +85,9 @@ Class | Method | HTTP request | Description *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/javascript/docs/StoreApi.md b/samples/client/petstore/javascript/docs/StoreApi.md index e1fa1a4fd50..0ef25bf703d 100644 --- a/samples/client/petstore/javascript/docs/StoreApi.md +++ b/samples/client/petstore/javascript/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 36cc93dc021..960b24323ce 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -69,7 +69,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -84,7 +84,7 @@ var returnType = null; return this.apiClient.callApi( - '/store/order/{orderId}', 'DELETE', + '/store/order/{order_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); @@ -154,7 +154,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -169,7 +169,7 @@ var returnType = Order; return this.apiClient.callApi( - '/store/order/{orderId}', 'GET', + '/store/order/{order_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 725b8e463b2..28d623894ed 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -348,9 +348,9 @@ Class | Method | HTTP request | Description *PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 0bbdaf511f4..6d699816186 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -9,9 +9,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index 87589c7a7ec..a7972ed21ab 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -82,7 +82,7 @@ sub delete_order { } # parse inputs - my $_resource_path = '/store/order/{orderId}'; + my $_resource_path = '/store/order/{order_id}'; my $_method = 'DELETE'; my $query_params = {}; @@ -98,7 +98,7 @@ sub delete_order { # path params if ( exists $args{'order_id'}) { - my $_base_variable = "{" . "orderId" . "}"; + my $_base_variable = "{" . "order_id" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); $_resource_path =~ s/$_base_variable/$_base_value/g; } @@ -194,7 +194,7 @@ sub get_order_by_id { } # parse inputs - my $_resource_path = '/store/order/{orderId}'; + my $_resource_path = '/store/order/{order_id}'; my $_method = 'GET'; my $query_params = {}; @@ -210,7 +210,7 @@ sub get_order_by_id { # path params if ( exists $args{'order_id'}) { - my $_base_variable = "{" . "orderId" . "}"; + my $_base_variable = "{" . "order_id" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); $_resource_path =~ s/$_base_variable/$_base_value/g; } diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 49216f7fb34..0444bdd3f19 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -86,9 +86,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 8c0930563fb..d959d6141d0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet 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 e3d7e466722..bfa8fd71583 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -118,7 +118,7 @@ class StoreApi throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder'); } // parse inputs - $resourcePath = "/store/order/{orderId}"; + $resourcePath = "/store/order/{order_id}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -132,7 +132,7 @@ class StoreApi // path params if ($order_id !== null) { $resourcePath = str_replace( - "{" . "orderId" . "}", + "{" . "order_id" . "}", $this->apiClient->getSerializer()->toPathValue($order_id), $resourcePath ); @@ -153,7 +153,7 @@ class StoreApi $httpBody, $headerParams, null, - '/store/order/{orderId}' + '/store/order/{order_id}' ); return [null, $statusCode, $httpHeader]; @@ -276,7 +276,7 @@ class StoreApi } // parse inputs - $resourcePath = "/store/order/{orderId}"; + $resourcePath = "/store/order/{order_id}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -290,7 +290,7 @@ class StoreApi // path params if ($order_id !== null) { $resourcePath = str_replace( - "{" . "orderId" . "}", + "{" . "order_id" . "}", $this->apiClient->getSerializer()->toPathValue($order_id), $resourcePath ); @@ -311,7 +311,7 @@ class StoreApi $httpBody, $headerParams, '\Swagger\Client\Model\Order', - '/store/order/{orderId}' + '/store/order/{order_id}' ); return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader]; diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index f1353f15b3d..217b9de54b7 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -80,9 +80,9 @@ Class | Method | HTTP request | Description *PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index 64e9ead0499..25c66e25ab2 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet 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 c3f1b7f77bd..1f1f2f336d6 100644 --- a/samples/client/petstore/python/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python/petstore_api/apis/store_api.py @@ -110,7 +110,7 @@ class StoreApi(object): path_params = {} if 'order_id' in params: - path_params['orderId'] = params['order_id'] + path_params['order_id'] = params['order_id'] query_params = {} @@ -127,7 +127,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api('/store/order/{orderId}', 'DELETE', + return self.api_client.call_api('/store/order/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -310,7 +310,7 @@ class StoreApi(object): path_params = {} if 'order_id' in params: - path_params['orderId'] = params['order_id'] + path_params['order_id'] = params['order_id'] query_params = {} @@ -327,7 +327,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api('/store/order/{orderId}', 'GET', + return self.api_client.call_api('/store/order/{order_id}', 'GET', path_params, query_params, header_params, diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index be935d849ba..02e13cfbbad 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -86,9 +86,9 @@ Class | Method | HTTP request | Description *Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 389f8337da1..aa7eaf03bf2 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet 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 6b8978f1b9e..9826b6ee5e5 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('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{order_id}".sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore end # resource path - local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{order_id}".sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} 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 faa408a2141..f6b937da861 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 @@ -25,7 +25,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -33,7 +33,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -99,7 +99,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -137,7 +137,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil 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 740bc511fff..369138f1d01 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 @@ -43,7 +43,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -51,7 +51,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -150,7 +150,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -188,7 +188,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil 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 465a7689469..5177e56f53c 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 @@ -45,7 +45,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -53,7 +53,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -156,7 +156,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -194,7 +194,7 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" + var path = "/store/order/{order_id}" path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 274b84d927d..7d839914389 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -421,10 +421,10 @@ export class PetApi { json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index 274b84d927d..7d839914389 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -421,10 +421,10 @@ export class PetApi { json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { 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 dc11a9593fa..1bc82b0c604 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -348,7 +348,7 @@ paths: description: "Invalid Order" x-contentType: "application/json" x-accepts: "application/json" - /store/order/{orderId}: + /store/order/{order_id}: get: tags: - "store" @@ -360,7 +360,7 @@ paths: - "application/xml" - "application/json" parameters: - - name: "orderId" + - name: "order_id" in: "path" description: "ID of pet that needs to be fetched" required: true @@ -390,7 +390,7 @@ paths: - "application/xml" - "application/json" parameters: - - name: "orderId" + - name: "order_id" in: "path" description: "ID of the order that needs to be deleted" required: true diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java index 6d6aa3848f7..097edd60859 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java @@ -32,7 +32,7 @@ public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); @DELETE - @Path("/order/{orderId}") + @Path("/order/{order_id}") @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", }) @@ -40,7 +40,7 @@ public class StoreApi { @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(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId + public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId ) throws NotFoundException { return delegate.deleteOrder(orderId); @@ -59,7 +59,7 @@ public class StoreApi { return delegate.getInventory(); } @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @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", }) @@ -69,7 +69,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(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId ) throws NotFoundException { return delegate.getOrderById(orderId); 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 8ddeb8f3dea..2698ca445e6 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 @@ -25,13 +25,13 @@ import javax.validation.Valid; public interface StoreApi { @DELETE - @Path("/store/order/{orderId}") + @Path("/store/order/{order_id}") @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); + public void deleteOrder(@PathParam("order_id") String orderId); @GET @Path("/store/inventory") @@ -42,14 +42,14 @@ public interface StoreApi { public Map getInventory(); @GET - @Path("/store/order/{orderId}") + @Path("/store/order/{order_id}") @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); + public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId); @POST @Path("/store/order") diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java index 153fd729be4..3d0a9532b51 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java @@ -21,14 +21,14 @@ import javax.validation.constraints.*; public class StoreApi { @DELETE - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @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) }) - public Response deleteOrder(@PathParam("orderId") @ApiParam("ID of the order that needs to be deleted") String orderId) { + public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } @@ -46,7 +46,7 @@ public class StoreApi { } @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @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", }) @@ -54,7 +54,7 @@ public class 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) }) - public Response getOrderById(@PathParam("orderId") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { + public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index c50f78b74aa..93eb48692a0 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -362,7 +362,7 @@ } } }, - "/store/order/{orderId}" : { + "/store/order/{order_id}" : { "get" : { "tags" : [ "store" ], "summary" : "Find purchase order by ID", @@ -370,7 +370,7 @@ "operationId" : "getOrderById", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, @@ -401,7 +401,7 @@ "operationId" : "deleteOrder", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, diff --git a/samples/server/petstore/lumen/lib/app/Http/routes.php b/samples/server/petstore/lumen/lib/app/Http/routes.php index 35a8f3fe8cf..510b5ee2a50 100644 --- a/samples/server/petstore/lumen/lib/app/Http/routes.php +++ b/samples/server/petstore/lumen/lib/app/Http/routes.php @@ -118,14 +118,14 @@ $app->POST('/v2/store/order', 'StoreApi@placeOrder'); * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Output-Formats: [application/xml, application/json] */ -$app->DELETE('/v2/store/order/{orderId}', 'StoreApi@deleteOrder'); +$app->DELETE('/v2/store/order/{order_id}', 'StoreApi@deleteOrder'); /** * GET getOrderById * Summary: Find purchase order by ID * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Output-Formats: [application/xml, application/json] */ -$app->GET('/v2/store/order/{orderId}', 'StoreApi@getOrderById'); +$app->GET('/v2/store/order/{order_id}', 'StoreApi@getOrderById'); /** * POST createUser * Summary: Create user diff --git a/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml b/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml index ced8e85705b..a2b8cd0f5cc 100644 --- a/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml +++ b/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/nodejs/api/swagger.yaml b/samples/server/petstore/nodejs/api/swagger.yaml index ced8e85705b..a2b8cd0f5cc 100644 --- a/samples/server/petstore/nodejs/api/swagger.yaml +++ b/samples/server/petstore/nodejs/api/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: 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 227c85b9e55..a7cb2a4cc0e 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 @@ -26,10 +26,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -56,10 +56,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } 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 07ed22b7314..6a3afe25cbe 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 @@ -29,7 +29,7 @@ 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) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return delegate.deleteOrder(orderId); } @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } 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 7a756ae42b0..361b1d5dbe6 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 @@ -25,10 +25,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -49,10 +49,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) 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 07ed22b7314..6a3afe25cbe 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 @@ -29,7 +29,7 @@ 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) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return delegate.deleteOrder(orderId); } @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } 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 index b63234b59a4..ec189068d63 100644 --- 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 @@ -27,10 +27,10 @@ public interface StoreApi { @ApiImplicitParams({ }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -55,10 +55,10 @@ public interface StoreApi { @ApiImplicitParams({ }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) 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 index 97a1b7e5129..f5446d8d0d1 100644 --- 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 @@ -24,7 +24,7 @@ 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) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -34,7 +34,7 @@ public class StoreApiController implements StoreApi { 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) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } 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 7a756ae42b0..361b1d5dbe6 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 @@ -25,10 +25,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -49,10 +49,10 @@ public interface StoreApi { @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}", + @RequestMapping(value = "/store/order/{order_id}", 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); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java index 97a1b7e5129..f5446d8d0d1 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ 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) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -34,7 +34,7 @@ public class StoreApiController implements StoreApi { 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) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } From 2e8eea9c1832735babc7eb499bceaa3e43b79a51 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Apr 2017 19:01:43 +0800 Subject: [PATCH 11/13] add logic to camelize path variables for feign client (#5301) --- .../codegen/languages/JavaClientCodegen.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 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 acfd7d78469..898474c44af 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 @@ -242,14 +242,14 @@ public class JavaClientCodegen extends AbstractJavaCodegen @Override public Map postProcessOperations(Map objs) { super.postProcessOperations(objs); - if(usesAnyRetrofitLibrary()) { + if (usesAnyRetrofitLibrary()) { Map operations = (Map) objs.get("operations"); if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { if (operation.hasConsumes == Boolean.TRUE) { - if ( isMultipartType(operation.consumes) ) { + if (isMultipartType(operation.consumes)) { operation.isMultipart = Boolean.TRUE; } else { @@ -264,6 +264,27 @@ public class JavaClientCodegen extends AbstractJavaCodegen } } } + + // camelize path variables for Feign client + if ("feign".equals(getLibrary())) { + 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; } From 7db3388fdcec312b03a04f2e0034ca818a0501df Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Apr 2017 21:39:48 +0800 Subject: [PATCH 12/13] Update maven compiler plugin to the latest version (3.6.1) (#5300) * update maven compiler plugin to the latest version * update feign petstore --- .../src/main/resources/Java/libraries/jersey2/pom.mustache | 2 +- .../main/resources/Java/libraries/retrofit/pom.mustache | 2 +- .../swagger-codegen/src/main/resources/Java/pom.mustache | 2 +- .../src/main/resources/akka-scala/pom.mustache | 7 +++---- .../src/main/resources/android/pom.mustache | 6 +++--- .../src/main/resources/codegen/pom.mustache | 6 +++--- .../swagger-codegen/src/main/resources/scala/pom.mustache | 6 +++--- pom.xml | 2 +- samples/client/petstore/akka-scala/pom.xml | 7 +++---- samples/client/petstore/android/httpclient/pom.xml | 6 +++--- samples/client/petstore/java/jersey1/pom.xml | 2 +- samples/client/petstore/java/jersey2-java6/pom.xml | 2 +- samples/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/client/petstore/java/jersey2/pom.xml | 2 +- samples/client/petstore/java/retrofit/pom.xml | 2 +- samples/client/petstore/scala/pom.xml | 6 +++--- 16 files changed, 30 insertions(+), 32 deletions(-) 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 ca467aa29ba..d4d043bb0fa 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 @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 {{#java8}} 1.8 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 05c0e7dbe3a..b7fbdb15fe4 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 @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index 43e45ee68fa..67d4ba4d2ac 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 {{#java8}} 1.8 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 8c8c377ee7f..8e2790095b1 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache @@ -104,11 +104,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index 758e9d62d07..355163a0455 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -98,10 +98,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache index 30f1b14872c..11e4a76e337 100644 --- a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache @@ -78,10 +78,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index f0292f5789d..11331dce41d 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -103,10 +103,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/pom.xml b/pom.xml index ce57b334d54..5a2562053ac 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ maven-compiler-plugin - 3.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/akka-scala/pom.xml b/samples/client/petstore/akka-scala/pom.xml index d37f26cfb4c..5593f09884a 100644 --- a/samples/client/petstore/akka-scala/pom.xml +++ b/samples/client/petstore/akka-scala/pom.xml @@ -104,11 +104,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 5ba936a5701..75ef31f534d 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -98,10 +98,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 3ba83ba77f6..f15b614e1aa 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index f8833b5216b..375f01b23de 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index ac527b7d825..1f8805518bc 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.8 1.8 diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index e4e73cfc097..fbf552cc133 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index aaa9654d87a..069c8bb3ed2 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index e61ecd8f0f9..a54aac0067d 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -103,10 +103,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 From 39bd0175b7f6e6ddb8114c270f3a766fa60c6032 Mon Sep 17 00:00:00 2001 From: clasnake Date: Mon, 3 Apr 2017 08:01:43 +0100 Subject: [PATCH 13/13] Pr4855 cherrypick (#5115) * Add async support to scala client. * Format api endpoints. * Modify build.sbt. * Change date format and pass StoreApis tests. * Add StringReader and StringWriter to support string serialization/deserialization. * update petstore samples for scala clients * Update maven and gradle dependency. Update tests to pass compilation. --- .../codegen/languages/ScalaClientCodegen.java | 15 +- .../main/resources/asyncscala/client.mustache | 1 + .../src/main/resources/scala/api.mustache | 197 ++++--- .../resources/scala/build.gradle.mustache | 7 + .../main/resources/scala/build.sbt.mustache | 59 +- .../src/main/resources/scala/client.mustache | 22 + .../src/main/resources/scala/pom.mustache | 6 + .../swagger/codegen/scala/ScalaModelTest.java | 4 +- .../io/swagger/client/SwaggerClient.scala | 1 + samples/client/petstore/scala/build.gradle | 7 + samples/client/petstore/scala/build.sbt | 59 +- samples/client/petstore/scala/pom.xml | 6 + .../scala/io/swagger/client/AsyncClient.scala | 20 + .../scala/io/swagger/client/api/PetApi.scala | 545 ++++++++++-------- .../io/swagger/client/api/StoreApi.scala | 278 +++++---- .../scala/io/swagger/client/api/UserApi.scala | 527 +++++++++-------- .../scala/io/swagger/client/model/Order.scala | 4 +- .../scala/src/test/scala/StoreApiTest.scala | 18 +- 18 files changed, 1019 insertions(+), 757 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/scala/client.mustache create mode 100644 samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java index 2044b80fc80..3efd6dcd101 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java @@ -9,6 +9,7 @@ import io.swagger.codegen.SupportingFile; import java.io.File; import java.util.Arrays; import java.util.HashMap; +import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -20,6 +21,7 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC protected String groupId = "io.swagger"; protected String artifactId = "swagger-scala-client"; protected String artifactVersion = "1.0.0"; + protected String clientName = "AsyncClient"; public ScalaClientCodegen() { super(); @@ -51,10 +53,13 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC additionalProperties.put("asyncHttpClient", asyncHttpClient); additionalProperties.put("authScheme", authScheme); additionalProperties.put("authPreemptive", authPreemptive); + additionalProperties.put("clientName", clientName); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("apiInvoker.mustache", (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala")); + supportingFiles.add(new SupportingFile("client.mustache", + (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), clientName + ".scala")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); // gradle settings @@ -75,8 +80,8 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC importMapping.remove("Set"); importMapping.remove("Map"); - importMapping.put("DateTime", "org.joda.time.DateTime"); - importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); + importMapping.put("Date", "java.util.Date"); + importMapping.put("ListBuffer", "scala.collections.mutable.ListBuffer"); typeMapping = new HashMap(); typeMapping.put("enum", "NSString"); @@ -90,7 +95,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC typeMapping.put("byte", "Byte"); typeMapping.put("short", "Short"); typeMapping.put("char", "Char"); - typeMapping.put("long", "Long"); typeMapping.put("double", "Double"); typeMapping.put("object", "Any"); typeMapping.put("file", "File"); @@ -98,6 +102,10 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC // mapped to String as a workaround typeMapping.put("binary", "String"); typeMapping.put("ByteArray", "String"); + typeMapping.put("date-time", "Date"); +// typeMapping.put("date", "Date"); +// typeMapping.put("Date", "Date"); + typeMapping.put("DateTime", "Date"); instantiationTypes.put("array", "ListBuffer"); instantiationTypes.put("map", "HashMap"); @@ -108,7 +116,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC @Override public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache index d48d031860e..87d830e3e6a 100644 --- a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache +++ b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache @@ -23,3 +23,4 @@ class {{clientName}}(config: SwaggerConfig) extends Closeable { client.close() } } + diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index c3dd3effe7d..5c8c5ec07b4 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -1,10 +1,11 @@ {{>licenseInfo}} package {{package}} +import java.text.SimpleDateFormat + {{#imports}}import {{import}} {{/imports}} -import {{invokerPackage}}.ApiInvoker -import {{invokerPackage}}.ApiException +import {{invokerPackage}}.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -16,13 +17,42 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + {{#operations}} class {{classname}}(val defBasePath: String = "{{{basePath}}}", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new {{classname}}AsyncHelper(client, config) {{#operation}} /** @@ -32,97 +62,82 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}", {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = { - // create path and map variables - val path = "{{{path}}}".replaceAll("\\{format\\}", "json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})){{/pathParams}} - - val contentTypes = List({{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}"application/json"{{/consumes}}) - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - {{#allParams}} - {{#required}} - {{^isPrimitiveType}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - - {{/isPrimitiveType}} - {{#isString}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - - {{/isString}} - {{/required}} - {{/allParams}} - {{#queryParams}} - {{#required}} - queryParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => queryParams += "{{baseName}}" -> paramVal.toString) - {{/required}} - {{/queryParams}} - - {{#headerParams}} - {{#required}} - headerParams += "{{baseName}}" -> {{paramName}} - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => headerParams += "{{baseName}}" -> paramVal) - {{/required}} - {{/headerParams}} - - var postBody: AnyRef = {{#bodyParam}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}.map(paramVal => paramVal){{/required}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}} - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - {{#formParams}} - {{#notFile}} - {{#required}} - mp.field("{{baseName}}", {{paramName}}.toString, MediaType.MULTIPART_FORM_DATA_TYPE) - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => mp.field("{{baseName}}", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - {{/required}} - {{/notFile}} - {{#isFile}} - {{#required}} - mp.field("{{baseName}}", file.getName) - mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE)) - {{/required}} - {{^required}} - file.map(fileVal => mp.field("{{baseName}}", fileVal.getName)) - {{paramName}}.map(paramVal => mp.bodyPart(new FileDataBodyPart("{{baseName}}", paramVal, MediaType.MULTIPART_FORM_DATA_TYPE))) - {{/required}} - {{/isFile}} - {{/formParams}} - postBody = mp - } else { - {{#formParams}} - {{#notFile}} - {{#required}} - formParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => formParams += "{{baseName}}" -> paramVal.toString) - {{/required}} - {{/notFile}} - {{/formParams}} - } - - try { - apiInvoker.invokeApi(basePath, path, "{{httpMethod}}", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - {{#returnType}} Some(apiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}]) - {{/returnType}} - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + val await = Try(Await.result({{operationId}}Async({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } } + /** + * {{summary}} asynchronously + * {{notes}} +{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} * @return Future({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}) + */ + def {{operationId}}Async({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}} = { + helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + } + + {{/operation}} } + +class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + +{{#operation}} + def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Some({{defaultValue}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}} + {{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, + {{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = { + // create path and map variables + val path = (addFmt("{{path}}"){{#pathParams}} + replaceAll ("\\{" + "{{baseName}}" + "\\}",{{paramName}}.toString){{/pathParams}}) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + {{#allParams}} + {{#required}} + {{^isPrimitiveType}} + if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") + {{/isPrimitiveType}} + {{#isString}} + if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") + + {{/isString}} + {{/required}} + {{/allParams}} + {{#queryParams}} + {{^required}} + {{paramName}} match { + case Some(param) => queryParams += "{{baseName}}" -> param.toString + case _ => queryParams + } + {{/required}} + {{#required}} + queryParams += "{{baseName}}" -> {{paramName}}.toString + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{^required}} + {{paramName}} match { + case Some(param) => headerParams += "{{baseName}}" -> param.toString + case _ => headerParams + } + {{/required}} + {{#required}} + headerParams += "{{baseName}}" -> {{paramName}}.toString + {{/required}} + {{/headerParams}} + + val resFuture = client.submit("{{httpMethod}}", path, queryParams.toMap, headerParams.toMap, {{#bodyParam}}writer.write({{paramName}}){{/bodyParam}}{{^bodyParam}}"{{emptyBodyParam}}"{{/bodyParam}}) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + +{{/operation}} + +} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache index 88faa3610b2..e124eb0a5c7 100644 --- a/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache @@ -104,6 +104,12 @@ ext { jackson_version = "2.4.2" junit_version = "4.8.1" scala_test_version = "2.2.4" + swagger_async_httpclient_version = "0.3.5" +} + +repositories { + mavenLocal() + mavenCentral() } dependencies { @@ -117,4 +123,5 @@ dependencies { testCompile "junit:junit:$junit_version" compile "joda-time:joda-time:$jodatime_version" compile "org.joda:joda-convert:$joda_version" + compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version" } diff --git a/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache index 6a198acb832..24ee01b6fd5 100644 --- a/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache @@ -1,33 +1,34 @@ -lazy val root = (project in file(".")). - settings( - version := "{{artifactVersion}}", - name := "{{artifactId}}", - organization := "{{groupId}}", - scalaVersion := "2.11.8", +version := "{{artifactVersion}}" - libraryDependencies ++= Seq( - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", - "com.sun.jersey" % "jersey-core" % "1.19", - "com.sun.jersey" % "jersey-client" % "1.19", - "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", - "org.jfarcand" % "jersey-ahc-client" % "1.0.5", - "io.swagger" % "swagger-core" % "1.5.8", - "joda-time" % "joda-time" % "2.2", - "org.joda" % "joda-convert" % "1.2", - "org.scalatest" %% "scalatest" % "2.2.4" % "test", - "junit" % "junit" % "4.8.1" % "test" - ), +name := "{{artifactId}}" - resolvers ++= Seq( - Resolver.jcenterRepo, - Resolver.mavenLocal - ), +organization := "{{groupId}}" - scalacOptions := Seq( - "-unchecked", - "-deprecation", - "-feature" - ), +scalaVersion := "2.11.8" + +libraryDependencies ++= Seq( + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", + "com.sun.jersey" % "jersey-core" % "1.19", + "com.sun.jersey" % "jersey-client" % "1.19", + "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", + "org.jfarcand" % "jersey-ahc-client" % "1.0.5", + "io.swagger" % "swagger-core" % "1.5.8", + "joda-time" % "joda-time" % "2.2", + "org.joda" % "joda-convert" % "1.2", + "org.scalatest" %% "scalatest" % "2.2.4" % "test", + "junit" % "junit" % "4.8.1" % "test", + "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" +) + +resolvers ++= Seq( + Resolver.mavenLocal +) + +scalacOptions := Seq( + "-unchecked", + "-deprecation", + "-feature" +) + +publishArtifact in (Compile, packageDoc) := false - publishArtifact in (Compile, packageDoc) := false - ) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scala/client.mustache b/modules/swagger-codegen/src/main/resources/scala/client.mustache new file mode 100644 index 00000000000..8098b73c6bb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scala/client.mustache @@ -0,0 +1,22 @@ +package {{invokerPackage}} + +{{#imports}}import {{import}} +{{/imports}} +import {{apiPackage}}._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class {{clientName}}(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index 11331dce41d..d459d29a975 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -209,6 +209,11 @@ joda-convert ${joda-version} + + com.wordnik.swagger + swagger-async-httpclient_2.10 + ${swagger-async-httpclient-version} + 2.10.4 @@ -223,6 +228,7 @@ 4.8.1 3.1.5 2.2.4 + 0.3.5 UTF-8 diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java index 95e08c6b362..57b9023b077 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java @@ -66,10 +66,10 @@ public class ScalaModelTest { Assert.assertEquals(property3.baseName, "createdAt"); Assert.assertEquals(property3.getter, "getCreatedAt"); Assert.assertEquals(property3.setter, "setCreatedAt"); - Assert.assertEquals(property3.datatype, "DateTime"); + Assert.assertEquals(property3.datatype, "Date"); Assert.assertEquals(property3.name, "createdAt"); Assert.assertEquals(property3.defaultValue, "null"); - Assert.assertEquals(property3.baseType, "DateTime"); + Assert.assertEquals(property3.baseType, "Date"); Assert.assertFalse(property3.hasMore); Assert.assertFalse(property3.required); Assert.assertTrue(property3.isNotContainer); diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala index f9f2e5d6216..7c4afb20e09 100644 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala +++ b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala @@ -25,3 +25,4 @@ class SwaggerClient(config: SwaggerConfig) extends Closeable { client.close() } } + diff --git a/samples/client/petstore/scala/build.gradle b/samples/client/petstore/scala/build.gradle index 979db7783c4..707c4f9e988 100644 --- a/samples/client/petstore/scala/build.gradle +++ b/samples/client/petstore/scala/build.gradle @@ -104,6 +104,12 @@ ext { jackson_version = "2.4.2" junit_version = "4.8.1" scala_test_version = "2.2.4" + swagger_async_httpclient_version = "0.3.5" +} + +repositories { + mavenLocal() + mavenCentral() } dependencies { @@ -117,4 +123,5 @@ dependencies { testCompile "junit:junit:$junit_version" compile "joda-time:joda-time:$jodatime_version" compile "org.joda:joda-convert:$joda_version" + compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version" } diff --git a/samples/client/petstore/scala/build.sbt b/samples/client/petstore/scala/build.sbt index 063b2b0d490..bececaf181b 100644 --- a/samples/client/petstore/scala/build.sbt +++ b/samples/client/petstore/scala/build.sbt @@ -1,33 +1,34 @@ -lazy val root = (project in file(".")). - settings( - version := "1.0.0", - name := "swagger-scala-client", - organization := "io.swagger", - scalaVersion := "2.11.8", +version := "1.0.0" - libraryDependencies ++= Seq( - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", - "com.sun.jersey" % "jersey-core" % "1.19", - "com.sun.jersey" % "jersey-client" % "1.19", - "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", - "org.jfarcand" % "jersey-ahc-client" % "1.0.5", - "io.swagger" % "swagger-core" % "1.5.8", - "joda-time" % "joda-time" % "2.2", - "org.joda" % "joda-convert" % "1.2", - "org.scalatest" %% "scalatest" % "2.2.4" % "test", - "junit" % "junit" % "4.8.1" % "test" - ), +name := "swagger-scala-client" - resolvers ++= Seq( - Resolver.jcenterRepo, - Resolver.mavenLocal - ), +organization := "io.swagger" - scalacOptions := Seq( - "-unchecked", - "-deprecation", - "-feature" - ), +scalaVersion := "2.11.8" + +libraryDependencies ++= Seq( + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", + "com.sun.jersey" % "jersey-core" % "1.19", + "com.sun.jersey" % "jersey-client" % "1.19", + "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", + "org.jfarcand" % "jersey-ahc-client" % "1.0.5", + "io.swagger" % "swagger-core" % "1.5.8", + "joda-time" % "joda-time" % "2.2", + "org.joda" % "joda-convert" % "1.2", + "org.scalatest" %% "scalatest" % "2.2.4" % "test", + "junit" % "junit" % "4.8.1" % "test", + "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" +) + +resolvers ++= Seq( + Resolver.mavenLocal +) + +scalacOptions := Seq( + "-unchecked", + "-deprecation", + "-feature" +) + +publishArtifact in (Compile, packageDoc) := false - publishArtifact in (Compile, packageDoc) := false - ) \ No newline at end of file diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index a54aac0067d..02c83f264df 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -209,6 +209,11 @@ joda-convert ${joda-version} + + com.wordnik.swagger + swagger-async-httpclient_2.10 + ${swagger-async-httpclient-version} + 2.10.4 @@ -223,6 +228,7 @@ 4.8.1 3.1.5 2.2.4 + 0.3.5 UTF-8 diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala new file mode 100644 index 00000000000..c518277f577 --- /dev/null +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala @@ -0,0 +1,20 @@ +package io.swagger.client + +import io.swagger.client.api._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class AsyncClient(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index 3bcadab73c9..2941fd914f4 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -12,11 +12,12 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.ApiResponse import java.io.File import io.swagger.client.model.Pet -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -28,12 +29,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new PetApiAsyncHelper(client, config) /** * Add a new pet to the store @@ -42,39 +72,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def addPet(body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json", "application/xml") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(addPetAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Add a new pet to the store asynchronously + * + * @param body Pet object that needs to be added to the store + * @return Future(void) + */ + def addPetAsync(body: Pet) = { + helper.addPet(body) + } + + /** * Deletes a pet * @@ -83,38 +99,26 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deletePet(petId: Long, apiKey: Option[String] = None) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - apiKey.map(paramVal => headerParams += "api_key" -> paramVal) - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deletePetAsync(petId, apiKey), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Deletes a pet asynchronously + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return Future(void) + */ + def deletePetAsync(petId: Long, apiKey: Option[String] = None) = { + helper.deletePet(petId, apiKey) + } + + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -122,41 +126,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return List[Pet] */ def findPetsByStatus(status: List[String]): Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByStatus".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") - - queryParams += "status" -> status.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(findPetsByStatusAsync(status), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Finds Pets by status asynchronously + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return Future(List[Pet]) + */ + def findPetsByStatusAsync(status: List[String]): Future[List[Pet]] = { + helper.findPetsByStatus(status) + } + + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -164,41 +152,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return List[Pet] */ def findPetsByTags(tags: List[String]): Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByTags".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") - - queryParams += "tags" -> tags.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(findPetsByTagsAsync(tags), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Finds Pets by tags asynchronously + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return Future(List[Pet]) + */ + def findPetsByTagsAsync(tags: List[String]): Future[List[Pet]] = { + helper.findPetsByTags(tags) + } + + /** * Find pet by ID * Returns a single pet @@ -206,38 +178,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Pet */ def getPetById(petId: Long): Option[Pet] = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getPetByIdAsync(petId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Find pet by ID asynchronously + * Returns a single pet + * @param petId ID of pet to return + * @return Future(Pet) + */ + def getPetByIdAsync(petId: Long): Future[Pet] = { + helper.getPetById(petId) + } + + /** * Update an existing pet * @@ -245,39 +204,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updatePet(body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json", "application/xml") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(updatePetAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Update an existing pet asynchronously + * + * @param body Pet object that needs to be added to the store + * @return Future(void) + */ + def updatePetAsync(body: Pet) = { + helper.updatePet(body) + } + + /** * Updates a pet in the store with form data * @@ -287,41 +232,27 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/x-www-form-urlencoded") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - name.map(paramVal => mp.field("name", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - status.map(paramVal => mp.field("status", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - postBody = mp - } else { - name.map(paramVal => formParams += "name" -> paramVal.toString) - status.map(paramVal => formParams += "status" -> paramVal.toString) + val await = Try(Await.result(updatePetWithFormAsync(petId, name, status), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Updates a pet in the store with form data asynchronously + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Future(void) + */ + def updatePetWithFormAsync(petId: Long, name: Option[String] = None, status: Option[String] = None) = { + helper.updatePetWithForm(petId, name, status) + } + + /** * uploads an image * @@ -331,40 +262,172 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return ApiResponse */ def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Option[ApiResponse] = { - // create path and map variables - val path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("multipart/form-data") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - additionalMetadata.map(paramVal => mp.field("additionalMetadata", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - file.map(fileVal => mp.field("file", fileVal.getName)) - file.map(paramVal => mp.bodyPart(new FileDataBodyPart("file", paramVal, MediaType.MULTIPART_FORM_DATA_TYPE))) - postBody = mp - } else { - additionalMetadata.map(paramVal => formParams += "additionalMetadata" -> paramVal.toString) + val await = Try(Await.result(uploadFileAsync(petId, additionalMetadata, file), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[ApiResponse]).asInstanceOf[ApiResponse]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + } + + /** + * uploads an image asynchronously + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return Future(ApiResponse) + */ + def uploadFileAsync(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Future[ApiResponse] = { + helper.uploadFile(petId, additionalMetadata, file) + } + + +} + +class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) } } + def deletePet(petId: Long, + apiKey: Option[String] = None + )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + apiKey match { + case Some(param) => headerParams += "api_key" -> param.toString + case _ => headerParams + } + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def findPetsByStatus(status: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { + // create path and map variables + val path = (addFmt("/pet/findByStatus")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") + queryParams += "status" -> status.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def findPetsByTags(tags: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { + // create path and map variables + val path = (addFmt("/pet/findByTags")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") + queryParams += "tags" -> tags.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getPetById(petId: Long)(implicit reader: ClientResponseReader[Pet]): Future[Pet] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") + + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updatePetWithForm(petId: Long, + name: Option[String] = None, + status: Option[String] = None + )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def uploadFile(petId: Long, + additionalMetadata: Option[String] = None, + file: Option[File] = None + )(implicit reader: ClientResponseReader[ApiResponse]): Future[ApiResponse] = { + // create path and map variables + val path = (addFmt("/pet/{petId}/uploadImage") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala index 3f72757f9eb..cb2ebf47255 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -12,9 +12,10 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.Order -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -26,12 +27,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new StoreApiAsyncHelper(client, config) /** * Delete purchase order by ID @@ -40,77 +70,49 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deleteOrder(orderId: String) = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deleteOrderAsync(orderId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Delete purchase order by ID asynchronously + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return Future(void) + */ + def deleteOrderAsync(orderId: String) = { + helper.deleteOrder(orderId) + } + + /** * Returns pet inventories by status * Returns a map of status codes to quantities * @return Map[String, Integer] */ def getInventory(): Option[Map[String, Integer]] = { - // create path and map variables - val path = "/store/inventory".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getInventoryAsync(), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "map", classOf[Integer]).asInstanceOf[Map[String, Integer]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Returns pet inventories by status asynchronously + * Returns a map of status codes to quantities + * @return Future(Map[String, Integer]) + */ + def getInventoryAsync(): Future[Map[String, Integer]] = { + helper.getInventory() + } + + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -118,38 +120,25 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Order */ def getOrderById(orderId: Long): Option[Order] = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getOrderByIdAsync(orderId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Find purchase order by ID asynchronously + * 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 + * @return Future(Order) + */ + def getOrderByIdAsync(orderId: Long): Future[Order] = { + helper.getOrderById(orderId) + } + + /** * Place an order for a pet * @@ -157,38 +146,93 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Order */ def placeOrder(body: Order): Option[Order] = { - // create path and map variables - val path = "/store/order".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(placeOrderAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + } + + /** + * Place an order for a pet asynchronously + * + * @param body order placed for purchasing the pet + * @return Future(Order) + */ + def placeOrderAsync(body: Order): Future[Order] = { + helper.placeOrder(body) + } + + +} + +class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def deleteOrder(orderId: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/store/order/{orderId}") + replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") + + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) } } + def getInventory()(implicit reader: ClientResponseReader[Map[String, Integer]]): Future[Map[String, Integer]] = { + // create path and map variables + val path = (addFmt("/store/inventory")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getOrderById(orderId: Long)(implicit reader: ClientResponseReader[Order]): Future[Order] = { + // create path and map variables + val path = (addFmt("/store/order/{orderId}") + replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { + // create path and map variables + val path = (addFmt("/store/order")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala index df039c1f7cc..7893cc26677 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala @@ -12,9 +12,10 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.User -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -26,12 +27,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new UserApiAsyncHelper(client, config) /** * Create user @@ -40,39 +70,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUser(body: User) = { - // create path and map variables - val path = "/user".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUserAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Create user asynchronously + * This can only be done by the logged in user. + * @param body Created user object + * @return Future(void) + */ + def createUserAsync(body: User) = { + helper.createUser(body) + } + + /** * Creates list of users with given input array * @@ -80,39 +96,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUsersWithArrayInput(body: List[User]) = { - // create path and map variables - val path = "/user/createWithArray".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUsersWithArrayInputAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Creates list of users with given input array asynchronously + * + * @param body List of user object + * @return Future(void) + */ + def createUsersWithArrayInputAsync(body: List[User]) = { + helper.createUsersWithArrayInput(body) + } + + /** * Creates list of users with given input array * @@ -120,39 +122,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUsersWithListInput(body: List[User]) = { - // create path and map variables - val path = "/user/createWithList".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUsersWithListInputAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Creates list of users with given input array asynchronously + * + * @param body List of user object + * @return Future(void) + */ + def createUsersWithListInputAsync(body: List[User]) = { + helper.createUsersWithListInput(body) + } + + /** * Delete user * This can only be done by the logged in user. @@ -160,39 +148,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deleteUser(username: String) = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deleteUserAsync(username), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Delete user asynchronously + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return Future(void) + */ + def deleteUserAsync(username: String) = { + helper.deleteUser(username) + } + + /** * Get user by user name * @@ -200,40 +174,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return User */ def getUserByName(username: String): Option[User] = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getUserByNameAsync(username), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Get user by user name asynchronously + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return Future(User) + */ + def getUserByNameAsync(username: String): Future[User] = { + helper.getUserByName(username) + } + + /** * Logs user into the system * @@ -242,81 +201,50 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return String */ def loginUser(username: String, password: String): Option[String] = { - // create path and map variables - val path = "/user/login".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") - - if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") - - queryParams += "username" -> username.toString - queryParams += "password" -> password.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(loginUserAsync(username, password), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Logs user into the system asynchronously + * + * @param username The user name for login + * @param password The password for login in clear text + * @return Future(String) + */ + def loginUserAsync(username: String, password: String): Future[String] = { + helper.loginUser(username, password) + } + + /** * Logs out current logged in user session * * @return void */ def logoutUser() = { - // create path and map variables - val path = "/user/logout".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(logoutUserAsync(), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Logs out current logged in user session asynchronously + * + * @return Future(void) + */ + def logoutUserAsync() = { + helper.logoutUser() + } + + /** * Updated user * This can only be done by the logged in user. @@ -325,39 +253,170 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updateUser(username: String, body: User) = { + val await = Try(Await.result(updateUserAsync(username, body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None + } + + } + + /** + * Updated user asynchronously + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return Future(void) + */ + def updateUserAsync(username: String, body: User) = { + helper.updateUser(username, body) + } + + +} + +class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) + val path = (addFmt("/user")) - val contentTypes = List("application/json") - val contentType = contentTypes(0) + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/createWithArray")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/createWithList")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def deleteUser(username: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") + + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getUserByName(username: String)(implicit reader: ClientResponseReader[User]): Future[User] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def loginUser(username: String, + password: String)(implicit reader: ClientResponseReader[String]): Future[String] = { + // create path and map variables + val path = (addFmt("/user/login")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") + + if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") + + queryParams += "username" -> username.toString + queryParams += "password" -> password.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def logoutUser()(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/logout")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updateUser(username: String, + body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser") if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser") - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { - } - - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) } } + } 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 a88c0ec23d9..84691796eaf 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 @@ -12,13 +12,13 @@ package io.swagger.client.model -import org.joda.time.DateTime +import java.util.Date case class Order ( id: Option[Long], petId: Option[Long], quantity: Option[Integer], - shipDate: Option[DateTime], + shipDate: Option[Date], /* Order Status */ status: Option[String], complete: Option[Boolean] diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala index 4c1a06f1cb6..78932dc10a3 100644 --- a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala @@ -1,7 +1,8 @@ import io.swagger.client._ import io.swagger.client.api._ import io.swagger.client.model._ - +import org.joda.time.DateTime + import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest._ @@ -9,6 +10,7 @@ import org.scalatest._ import scala.collection.mutable.{ ListBuffer, HashMap } import scala.collection.JavaConverters._ import scala.beans.BeanProperty +import java.util.Date @RunWith(classOf[JUnitRunner]) class StoreApiTest extends FlatSpec with Matchers { @@ -18,7 +20,7 @@ class StoreApiTest extends FlatSpec with Matchers { api.apiInvoker.defaultHeaders += "api_key" -> "special-key" it should "place and fetch an order" in { - val now = new org.joda.time.DateTime + val now = new Date() val order = Order( petId = Some(10), id = Some(1000), @@ -31,18 +33,17 @@ class StoreApiTest extends FlatSpec with Matchers { api.getOrderById(1000) match { case Some(order) => { - 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.get.getMillis.equals(now.getMillis) should be(true) + order.id.get should be(1000) + order.petId.get should be(10) + order.quantity.get should be(101) + order.shipDate.get.getTime().equals(now.getTime()) should be(true) } case None => fail("didn't find order created") } } it should "delete an order" in { - val now = new org.joda.time.DateTime + val now = new Date() val order = Order( id = Some(1001), petId = Some(10), @@ -59,6 +60,7 @@ class StoreApiTest extends FlatSpec with Matchers { } api.deleteOrder("1001") + val x = api.getOrderById(1001) api.getOrderById(1001) match { case Some(order) => fail("order should have been deleted") case None =>